Meta accounts are here: you can create a Meta account to log into VR devices. Learn more

OBJECT COLLISIONS

What if we want the water balloon to splash on a wall or another object? We can do this by bringing over the When Colliding With Object event.

PREREQUISITE READING

TOGGLE INTERACTION precedes this tutorial


To easily run codeblocks from another event, grab Send Event to Object from the bottom of the events tab. We are going to click on the drop down and select CollisionEnter. On our values tab, bring the Server Player variable into the New Param slot. Now when Collision Enters with Object, we run all of the events in the When Colliding With Player event. Please note that to send an event to an object, the parameters must match the received event. In this case we know that the CollisionEnter event is received with a Player Variable, so we send the Server Player variable as a substitute, since there isn’t actually a player collision occurring.
With our script done, we need to go to the more tab of our water balloon. Change it from Players, to Both Objects and Players, then let’s set the tag to Wall.
Then on the object we want to splash on, from the attributes tab, change it’s tag to Wall. Now try throwing the water balloon at the wall to test it out.

Next Up