I try to put my player back with the script, but when the player looks the other way, it moves on the x-axis instead of the z-axis. I have tried using on local but so far I am not getting the right result.
This looks odd as well. Sounds like you are trying to rotate 180 degrees, if so as you are getting the euler angles from global space, you should also set them in global space (use this.entity.setEulerAngles).
Yes that is what I do, so if the player stops climbing because he is reaching the ground I rotate the player with his back to the wall and a little bit from the wall (to prevent the player from immediately climbing again without this being the intention).
So with the first lines of code I set the player on the wall by start climbing and with the last line of code I set the player back on the ground by stop climbing.
I implanted your example in my project and this works great! Much better than how it was. Thank you so much for that!
Only for ending the climbing I still have the same problem. I try to use the position and rotation of the hitMarkerEntity (in my case climbPoint) to put the player back on the ground but the offset only takes place on the good axis and in the good direction if I approached the object from the front.
It’s the same problem as the climbing and should use a similar solution. It’s using absolute world coordinates and offsets when it should be positioned relative to the orientation of the wall and ground.
It depends on whether you expect it to change over time. If it’s a stationary entity, sure, you could cache the position in the initialize function. But if the entity changes its position over time, then you’ll need to call getPosition whenever you need the latest position.