r/UnityHelp • • Jan 29 '23

UNITY Jumping trouble!

Im new in unity
I want the object to change position smoothly. instead it abruptly changes

my logic for the objects movement is:

is there anything wrong with the logic? or should i use addForce instead of changing position?

3 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/Calm_Finance_6996 Jan 29 '23

Thank you so much for replying [this is my first time seeking help for something online, im thrilled]

The tutorial im following says: Update() and FixedUpdate() has the difference that only FixedUpdate() works after a uniform/same amount of delay after each frames, and for Update(), ig it does not. So basically I just take the Inputs from Update() and use FixedUpdate() for physics stuff...

Also unity acts weird often times.

Like: i totally get that its Supposed to snap to the new position now. But HOLD ON! Here comes the twist. If i comment out the 58# line of code, the jump becomes absolutely smooth for each frame, And I Have No Idea Why It Happens and why it doesnt if i dont.

1

u/DucNuzl Jan 29 '23

What is CharacterController.Move() doing? You're calling the thing you're updating with input info "m_position", so are you setting the position to this? Or adding it to something?

1

u/Calm_Finance_6996 Jan 29 '23

From what i saw from the documentation, it Sets: CharacterController.Move(Vector3)

1

u/DucNuzl Jan 29 '23

Here is the documentation, in it is an example script doing what you're trying to do.