Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How can i redirect movement to direction that i need.

Discussion in 'Scripting' started by PashaGamesProduction, Mar 24, 2020.

  1. PashaGamesProduction

    PashaGamesProduction

    Joined:
    Nov 29, 2019
    Posts:
    1
    So i just creating some kind of fan-made sequel of "Portal 2" logic game made originally by Valve.
    I made working portals and they work fine if not include this issue. So while i am dropping object in portal from top and portal is looking on top too it inverts its velocity and its working fine. But when i try to do portals that have angle (Like on walls or on slopes) it still remains vertical velocity. That's problem i need change velocity so it will still be the same but it will have horizontal velocity calculated by portals angle. (I dont need remain vertical speed fully)
    How could i make it work like on picture?
     
  2. RPGFabi

    RPGFabi

    Joined:
    Oct 24, 2019
    Posts:
    29


    check this out

    should be enough for the project