Hi
I am using the move to marker on the hotspot.
Is there a way to have the player keep it current direction while moving?
I have a swinging door and when the player is too close the door and player collides. I would like the player to take step back rather than turning around.
atm i am using interaction boundary as a workaround but it doesn't quite feel natural.
thanks
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Is it that the door is causing the Player to turn, or just that the NavMesh requires the Player to turn around to reach the Hotspot's Marker?
It's a bit hacky, but you should be able to lock the rotation with this script (LockDirectionToHotspot.cs), attached to the Hotspot:
i tried using this but player just tries his hardest to to walk into the hotspot(on the door) rather than taking a step backwards
to answer your first question, its not the door thats turning the player its the navigation.
im not using a navmesh, just using walk to marker from the hotspot.
I'm not clear on the behaviour - is this a case of the movement being incorrect, or just the rotation?
If you can share a video/annoted screenshots of the behaviour (both before and after the script, if there's a difference), it'll help clarify the underlying situation.
Hi Below is link,
before script


after script.
thanks
Thanks for the clear explanation.
The camera turns because the Player is moving backward to reach the Marker. What you can do instead is rely on the Moveable component to simply beeline to the Marker without the use of pathfinding.
Set the Hotspot's Player action field to Do Nothing, attach a Moveable component to your Player prefab, and then begin your Interaction with an Object: Transform Action.
In this Action, check Move Player?, and set the field beneath to Copy Marker. Reference the Hotspot's "Walk-to" Marker, and adjust the transition values to suit. The Player should then lerp from where they are to the Marker in a straight line - also accounting for the Marker's rotation.
Thanks! that seems to do the trick.
I did try the object transform on the player before but i didnt realise that i needed the moveable component on the player.
thanks for the great support