Answer the question
In order to leave comments, you need to log in
Why does the position not change?
The character falls from y = 50, there is a plane trigger on y = 0.
The script is attached to the character, the log outputs, but the position does not change (the character is assigned to obj).
What could be wrong?
void OnTriggerEnter(Collider other)
{
Debug.Log("TRigger");
obj.transform.position = new Vector3(0f, 300f, 0f);
}
Answer the question
In order to leave comments, you need to log in
Something like that. I would describe more precisely what is happening on your stage in general.
obj.transform.position = obj.transform.position * new Vector3(0f, 300f, 0f);
Try this
void OnTriggerEnter(Collider other)
{
Debug.Log("TRigger");
transform.Translate(Vector3(0f, 300f, 0f));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question