question-circle How do I make the marble teleport to a certain area upon hitting an object

  • Posts: 19
  • Thank you received: 8
08 Jul 2026 03:08 #1
This is different from the teleporter trigger in PQ: The teleportation instantly happens when the function (shapename)::onCollision(%this, %obj) is executed. The destination point is just another named object just like the regular teleporter triggers. It may be useful for reducing the object count, or creating teleportation triggers that aren't shaped like cuboids (such as a spherical portal/wormhole). Do I just bring in the code for the trigger and paste it into the shape datablock's collision function?

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 6
09 Jul 2026 00:37 #2
Your onCollision should have a %col parameter, the marble. Store the destination position you want on the collided object as a dynamic field. Then just use %col.setTransform(%obj.destination) and add whatever extra effects you want, perhaps a playing a sound or setting the camera yaw, which could also be in dynamic fields.

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 0.361 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.