OnTriggerEvent possibly not firing

I’m trying to detect collision on a game object and then move another object in response. However, my Udon does not seem to do anything and I’m hoping someone here can point me in the right direction.

Here is what I created:

My intended flow is:

  1. The target object has an OnTriggerEnter, which is what I believe happens when it triggers an object that has been set Is Trigger to true.
  2. I check that the triggered object is the “GameActivateCollider”.
  3. If so, then I set the position of TestCube’s transform.

The object that I intend to collide with the “GameActivateCollider” has the following script settings which I think should pass in the correct objects:

Screenshot 2022-05-17 214815

Can anyone tell me what is wrong or missing with this?

Hey, maybe this will help you if I understand correctly:

Object X enters (GameActivateCollider) → Object Y moves (TestCube).

1 Like

Thanks. I’ll give this a try.

It works! Thanks so much, I’ve been trying to crack this one for ages.

Bonus question: if I want to move several objects, is there a way to do this optimally?

I would think putting the objects you want to move together into an array would be an optimal way to do it.

This should work:

I just changed the variable to an array and I then step through each index, and set its position using a FOR loop.

And of-course adding reference to all the GameObjects I would like to move.
2

This will however set each GameObjects position to the same position. You’ll have to see how to do them individually by checking the value of the index and doing something with that GameObject’s transform before it steps to the next index I guess. :slightly_smiling_face:

1 Like

Awesome! I’ll give this a go. :slight_smile:

This worked perfectly btw. Thank-you very much!