I’m looking to have a player be able to vault over a short wall/fence/etc… So the idea is if there are standing on one side, interact with the fence, they’ll “vault over it” to the other side.
Question is if there is an “easy” way to determine how far the player needs to be moved forward to be clear of the fence and on the other side?
So far, I’ve thought of using raycasting from the other direction to detect end point or raycasting downwards until I hit the ground.
Ideally, I’d like to take the forward direction of the player and determine which extent needs to be used to get them clearly to the other size (box collider assumed). Is this a reasonable approach?
I’ve resolved this by using the target objects collider and then accessing the “bounds” property to find what the world height is, once this is done you can simply adjust the player (using their collider bounds) and then run the animation.
Boa questão, pensei nisso também mais no momento estou desenvolvendo tudo o que eu deixei, fiquei parado mais de um ano, agora desaprendi tudo, espero que consiga, a ideia está ótima, vai tentando com os raycast e faz eles reposnder você pelo comando “print” e então vai mudando de pouco-a-pouco, boa sorte
English.
Good question, I thought that too but right now I’m developing all that I left, I stopped over a year now forgotten everything, I hope you get the idea is great, trying to go with raycast and do they answer you by the command "print "and then go changing little by little, good luck
I am quite new to Unity, and programming in general, but my initial suggestion for an easy solution would be to ensure that any ‘vaultable’ wall or fence should be a uniform height and depth. If that is acceptable for your desired wall-hopping, then you can count on a set height and depth for the character to have to ‘vault’ whenever they do, and only have to worry about rotating them so that they’re perpendicular to the low wall before they begin the vault.
Sorry if this solution isn’t helpful, it was the first time I came across a question here and thought ‘hey I might have a decent solution for that…’