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. Dismiss Notice

Vaulting over a wall (first person)

Discussion in 'Animation' started by milmalho, May 26, 2020.

  1. milmalho

    milmalho

    Joined:
    Feb 16, 2020
    Posts:
    18
    I'm trying to implement a vault over wall feature but am running into trouble. Right now I set up the "vaultable wall" to have a trigger and when the player enters the trigger and presses "space", it plays the vault animation. My issue is that it seems to only vault/animate on one side/in one spot. If I am on the opposite side of the wall or on the edge and try to vault it will teleport the player to the specific position and play the animation on that side.

    I tried animating it so its local and not global but I guess thats the wrong approach.

    Heres a video showing what I'm trying to explain
     
  2. spiritworld

    spiritworld

    Joined:
    Nov 26, 2014
    Posts:
    29
    How you detect the side and setup the landing spots? It looks like you have setup one start & end and it will translate you between those no matter which side you activate the box.

    I'd make two "end points" to each side of the box, and when interacting with it, use Vector3.Angle to detect whether I'm in front or back of the box and then decide into which end point to teleport.

    I have ONE-WAY ladder system which sets up starting and ending points (and moves character between their vector direction) so I don't have same problem but probably later need to make it bi-directional :D

    Your question would need some code shared in addition.
     
  3. spiritworld

    spiritworld

    Joined:
    Nov 26, 2014
    Posts:
    29
    Obscure045 likes this.