Hey everyone,
I'm working on a 2D game in Unity 6 (Unity 6000.0.42f1 ) using the newest Adventure Creator version.
I have a few issues I'd like to ask about – one of them is shown in a short video I'm linking below.
You can clearly see this behavior in the short video I attached.
→ I'd like to know if it's possible to transition directly to the target direction (e.g. from Walk_Left to Walk_Right), without going through an intermediate state like Down or Idle.
Are there recommended settings or techniques for handling this kind of directional switch in Adventure Creator?
I know I could move the capsule collider lower, but I'd rather ask:
→ Is there a recommended way to make the click target adjust automatically, so that the feet are placed more naturally at the click point?
→ Is there a way to set a “tolerance” for vertical offset, so that small Y differences are ignored?
For example, if the Y difference is less than 15 pixels (or units), I'd like the character to move purely horizontally instead.
Thanks a lot in advance – I appreciate any tips or recommendations on these three points!
Best,
LytonLight27
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
If you're looking to disable turning, so that he snaps to the given direction, you can set his Turn speed to -1.
You'll need to ensure their root object position is around their feet. With 2D characters, this is typically done by positioning each sprite's Pivot point so that it's around the character's feet. Then, when attached as the character's Sprite child with a local position of (0,0,0), they'll appear to be in the correct position.
It's possible to "flatten" a character's path through scripting. An example script can be found on the AC wiki:
https://adventure-creator.fandom.com/wiki/2D_point_and_click_along_one_axis
It'd be possible to have this run only if the change in Y position is less than a set distance - but pathfinding is an issue. Changing points on a navigation path can cause them to come off the NavMesh if you're not careful.
What you'd need to do is check each point on the path separately, and only adjust it if the "flattened" position is still on the NavMesh.
This should do it. Place in the scene, and assign the NavMesh's collider in its Inspector: