Hiya I couldn't find a proper solution using search so I thought I'd post.
ProblemI'm creating a game similar in vein to Deadlight and Rush N' Attack: Ex Patriot and I'm trying to figure out how to lock both the player character and enemy to the Y/Z axis (z being forward) and Y giving the player ability to jump/climb/change gravity e.t.c
What I've tried-I've tried getting the position of the Gameobjects, storing the float value and clamp - doesn't work as expected
-I've resorted to taking the input values for w/s out from the input manager... works but a hack and I forsee problems when adding a controller into the mix.
-I've given the enemy constraints on it's rigid body Z axis, which helps with collisions
My character is currently using the third person controller (need the wall jump function) a state containing a Get Axis Vector and smooth look at direction action. My enemy is using a capsule collider and rigidbody components.
Right now if the characters collide long enough they'll sort of do this dance and move around each other ignoring clamp values and so on.
Really need some help with this one as I'm about to add invisible wall colliders, creating a tunnel so the characters have to stay on path... but that's a hack that I know will get me in the end
thx!