Box Collider to Trigger Event

Hey there, everyone!
I am super new to Udon, first time using it yesterday kind of new. There is a video I found that is similar to what I am looking to achieve with an Udon Behavior but it was the old way through component triggers and am stuck.
Essentially, all I am trying to do is have an object, let’s say Cube for instance, that one would pick up and move across the world to another place within the world. Once this picked up Cube is placed on what I have set as Pedestal, the Box Collider in a specific place on this Pedestal would then trigger and animation or another action.
Anyone here that can possibly help me through this process? :slight_smile:

Hey there, first off you need to assign a rigidbody and a collider for both objects like that:


Make sure you have your items in the same layer, you can create new layer for both items as well.

Disable the particle in the scene and this code will enable it back:

The particle has to be set to play on awake (default)

What is the particle for? I am using 2 cubes, one which is a pickupCube, the second is a pedestalCube that is waiting to receive collision from the pickupCube to trigger an animation. Apologies if I wasn’t as clear as I could be, trying to find the words to describe what it is that I’m trying to achieve and still learning. :slight_smile:

This is the reference that I was trying to use and reformat and work through it but doesn’t seem like Events are named quite the same as in this video. I could be overlooking something also.

For some reason I was thinking about particles, my bad. It’s not too sure about playing animations through udon. But I’ll see if I can recreate that in udon :slight_smile:

No worries! I see a bunch of options in Udon for Box Colliders but have no idea which to choose from. I’m not sure if I have to create a variable that then couples the collider with the event or what. I’ll be trying but if you find out, please let me know! :slight_smile:

Alright I got it working, this is the code for your altar:

This is the animator:

You don’t need any parameters


End result:


This is exactly what I was looking for! Thank you so much! :heart_eyes:

Now, not to get too demanding/technical, but how would this work where it wouldn’t activate unless two of these were in position before it animated? Same premise?

It would get a bit more complicated:

  1. check what game object entered the trigger
  2. set the boolean to true if that the item
  3. If all booleans are checked play the animation
1 Like

Greatly appreciated, thank you so much for your help!

Apologies for being such a nuisance but I’m not sure how everything is connected as far as if the trigger is on the cube or sphere itself and how they correlate to the animations.

So as I said in my first post both altar and key objects need to have rigidbody and collider components.


you can use any collider, but make sure they have trigger selected.

In udon this node:

Will start if there’s a collision trigger (Object touches altar).

Then this:
Is the animator variable which you set up by pressing this circle and selecting an animator

1 Like

So basically you store the animations in the variable of udon code :sweat_smile:

1 Like

If you have any troubles just let me know, it’s not really a trouble for me :smile:

1 Like

Gave my brain a quick moment to rest. Jumping back in and will let you know. I greatly appreciate your help so much! :smile:

You can join my Discord so we can keep in touch. If you’re free at all today I have quite a large chunk to walk me through the next step because I really would like to grasp this concept and share with others! :slight_smile:

Hey y’all! Okay so first off, forgive my ignorance. I’ve been using Unity for like a week and I know NOTHING about coding, but I’m determined to make this happen. I want to create a levitation portal, like an elevator that goes up to the next floor. Someone suggested I go about it by effecting the player’s gravity. I ran with that and I like to try to problem solve on my own, but 24 hours later I still haven’t figured it out via google so I’m asking for the next step. Your answer above it the closest thing I’ve found to my solution, but I’m not quite there. This is what I have cobbled together so far, and i know I must be close. I created a cylinder, gave it a rigid body and a mesh collider, which I set to convex and made it a trigger. Then I gave that cylinder Udon Properties and set up the nodes like so. What am I missing? Btw I have no idea what the numerical gravity values should be, I just typed those in as a test, but nothing happens. Any idea?

Hey there! I know it’s probably not what you’d like but maybe you can just change the Jump Impulse. I’m thinking you’d more want the Player to be propelled upward, right? If that’s the case you’d just need to have the Vector3 position transformed upward and then once the Player reaches the top it’ll automatically switch back once they have Exited the cylinder. :slight_smile:

Also, you need to be sure to create a new layer so that the Player can collide with the Teleporter/Elevator. Like so! image|690x388