Im trying to make a portal like effect where you shoot two objects and when you go through one, you come out the other. How would I achieve this or is it possible?
Constrain a portals X&Y position to the 2 integers attributes & constrain its rotation to portalRotation.
Then make lets say when the ball collides with portal1, change self positionX to portalX, self.position.Y to portalY, & change self.rotation to portalrotation
Essentially the biggie here is, how can the object falling through portal 1 change it's direction when coming out portal 2. Meaning, let's say portal 1 is on the ground and portal 2 is on the left hand side but ANGLED towards the UPPER RIGHT of the screen. The idea would be, ball falls (building momentum) and then shoots out (with some momentum) out of portal 2 BUT at the NEW ANGLE of portal 2 (i.e. upper right direction).
Another example to be even more understandable. Portal 1 is on the floor. Portal 2 is on the left hand wall and it is facing the RIGHT HAND WALL. Ball builds momentum and falls into portal 1 and shoots out of portal 2 (TO THE RIGHT HAND DIRECTION... NOT MOVING DOWNWARD). That's the trick, I don't want it to continue moving downward I want it to shoot out in the direction of the portal but maintaining it's momentum etc.
Comments
Create 2 integer attributes, portalX & portalY
Create 1 angle attribute, PortalRotation
Constrain a portals X&Y position to the 2 integers attributes & constrain its rotation to portalRotation.
Then make lets say when the ball collides with portal1, change self positionX to portalX, self.position.Y to portalY, & change self.rotation to portalrotation
Tell me if it works
Matt
_________________________________________________
Full Game Creation Service
1 On 1 Project Help
PortA-X
PortA-Y
PortB-X
PortB-Y
PortA
Change: PortA-X to self.x
Change: PortA-Y to self.y
PortB
Change: PortB-X to self.x
Change: PortB-Y to self.y
Actor touches Portal A
Rule: If overlap for collide with actor
Change: self.x to PortB-X
Change: self.y to PortB-Y
Actor touches Portal B
Rule: If overlap for collide with actor
Change: self.x to PortA-X
Change: self.y to PortA-Y
-Allows you to go back and forth.
-Allows you to move the portals where ever and not have to change code
You can add a timer in the rule for a delay if needed.
Michael
Check out this video. It should help you out.
Nice use of resources hah.
Michael
NO disrespect intended. But I also knew darren had taken a lot of things into account with his warps.
Another example to be even more understandable.
Portal 1 is on the floor.
Portal 2 is on the left hand wall and it is facing the RIGHT HAND WALL.
Ball builds momentum and falls into portal 1 and shoots out of portal 2 (TO THE RIGHT HAND DIRECTION... NOT MOVING DOWNWARD). That's the trick, I don't want it to continue moving downward I want it to shoot out in the direction of the portal but maintaining it's momentum etc.
You guys are the best thanks!