Hey guys.
So for the past few days Ive been trying to make my caracter to properly run up slopes ( walls and loop de loops)
I got him align to the ground but as soon as reach an angle (90) where the player would be perpandicular to the world’s x/z plane ) he would stop moving.
The movement pattern I set up is prett simple
Direction = (h,0,v);
Direction = Camera.main.transform.TransformDirection(Direction)
rb.velocity += new Vector3(Direction.x,0,Direction.z)*Acceleration*Time.DeltaTime;
// RayCast code to get ground normal ... and rotate
transform.rotation=Quaternion.LookRotation(Vector3.Cross(transform.right,alignhit.normal.normalized),alignhit.normal);
if(rb.velocity.magnitude>0.1f)
mesh.transform.localRotation = Quaternion.LookRotation(rb.velocity,transform.up);
the mass of the rigidbody is set to 4 and the drag to 3
I tried nulling the drag and friction and this still happens…
I also noticed if I make the velocity " = "to the mesh’s transform.forward and multipliy it by a Speed float that increases/decreases depending on the input, the player would run almost fine on slopes.
But the thing is, adding to the velocity (+=) and then using it in LookRotation would save me alot of work cuz it makes the rotation smooth without using slerp and having to work around the rotation speed.
I hope someone here can lead me to the solution C: