Forum rules - please read before posting.

How to make player walk around 2D sprite

I have a scene where 2D sprite obstacles dynamically appear in the scene. How do I prevent my 2D player from walking through these sprites? I normally bake in holes into the navmesh, but in this case, I don't know the locations of the sprites until run time. I'm currently using point and click controls, but ideally, looking for a solution that can work for both point and click and direct control.

Comments

  • The Scene: Change setting Action can be used to add or remove NavMesh holes at runtime.

    Are the obstacles all the same size? If so, you can make the hole a prefab, spawn it in using Object: Add or remove, and then reference that spawned object in the above Action by mapping it to a GameObject parameter.

    To restrict 2D Direct-control movement to the NavMesh, check Auto-stick to NavMesh? in the Player Inspector when using Direct movement.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.