- Home /
Question by
unity_C11B1C70B448C64FCA50 · Mar 28 at 09:01 AM ·
rigidbodytransform.positionrigidbody.addforcejittering
Rigidbody interpolation conflicts with transform.position
ok so i was having problems with rigidbody jittering and learned about interpolation but the problem is that turning on interpolation creates conflict between rigidbody addForce and transform.position
how do i fix this?
edit: Basically i cant jump while moving
void Update()
{
var horizontal = Input.GetAxis("Horizontal");
var vertical = Input.GetAxis("Vertical");
if (isGrounded)
{
Jumps = MaxJumps;
}
Vector3 forward = Camera.main.transform.forward;
forward.y = 0;
transform.position += forward * vertical * Time.deltaTime * speed;
Vector3 right = Camera.main.transform.right;
right.y = 0;
transform.position += right * horizontal * Time.deltaTime * speed;
if (Input.GetButtonDown("Jump") && Jumps > 1)
{
rb.AddForce(new Vector3(0, jumpHeight, 0), ForceMode.Impulse);
Jumps--;
}
isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);
}
}
Comment
Your answer
Follow this Question
Related Questions
Have player fall down with platform? 0 Answers
Smooth dashing issues 0 Answers
Freeze Position + collision? 0 Answers
When Movement speed Change once it never change again 1 Answer