Portal Effect

bizarbizar Member Posts: 1
edited November -1 in Working with GS (Mac)
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?

Comments

  • JPickardJPickard Member Posts: 477
    It's possible. It's the basis for the D-capitatrix app.
  • RedlerTechRedlerTech Member Posts: 1,583
    ok, well

    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 :D

    Matt

    _________________________________________________
    Full Game Creation Service
    1 On 1 Project Help
  • outasiteoutasite Member Posts: 417
    Attributes:
    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
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934


    Check out this video. It should help you out.
  • outasiteoutasite Member Posts: 417
    WoW just post a vid and make me feel stupid.
    Nice use of resources hah.

    Michael
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    outasite said:
    WoW just post a vid and make me feel stupid.
    Nice use of resources hah.

    Michael

    LOL it actually took me like 15 min of digging through darren's vids to find it but I knew he had made one.

    NO disrespect intended. But I also knew darren had taken a lot of things into account with his warps.
  • RodrigoPerezRodrigoPerez Member Posts: 212
    Does that method also let the object build momentum like in D-capitatrix?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Whenever you go through a portal, unless you tell your actor to slow down etc, you will keep the momentum and trajectory the actor was going at
  • delorianhayzedelorianhayze Member Posts: 55
    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.

    You guys are the best thanks!
Sign In or Register to comment.