Portals

Hello,

I am trying to make an object similar to a “portal”, there are two on the screen. When another object touches the “portal” like a ball, the ball go through it and is shot out from the other portal on the screen with the same velocity. Also where ever the ball touches on the portal it comes out on the same side of the other portal that it hit. How can i do this?

Help is very appreciated!
Thank you! :slight_smile: [import]uid: 66985 topic_id: 12477 reply_id: 312477[/import]

The velocity could be saved when the ball hit the portal then applied to ball in the function that moves it to the portal it is exiting.

For the “same side”, I’m not sure when you are asking. Do you mean what would be the “front” and “back” or the portal? The top and bottom? Left and right?

With two “portals” the “same side” could mean a number of things. [import]uid: 52491 topic_id: 12477 reply_id: 45595[/import]

Thanks a lot !

But how can i save the current velocity when the ball touches the portal ? [import]uid: 66985 topic_id: 12477 reply_id: 45715[/import]

save it into a variable?

local v = somefalue

c [import]uid: 24 topic_id: 12477 reply_id: 45718[/import]