![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | tymkii |
Hey there, I’m fairly new to Godot - have read some of the Doc’s.
I am making a 3D game with “click to move” functionality, I am using this script:
http://kidscancode.org/godot_recipes/3d/click_to_move/
Everything works perfectly EXCEPT once it arrives at its destination it jitters annoyingly, I tried LERP but still couldn’t get the jitter to leave. one thing of note is that if i change the “close enough to target” distance to 2 instead of .5 it stops perfectly fine. I thought it might be the “move_and_slide” function call reseting causing the jitter but the fact that it doesn’t jitter after i change the distance to 2 has me puzzled.
My Player node(a seperate scene/ asset, velocity/movement script) is a child of my Floor node(static body, with script function for getting the click_position). --if this is a problem let me know, i looked it up but couldn’t find if it was.
^Just as I was typing this a thought occurred to me - could it be because the ground is a child mesh and that’s where i’m “clicking” but the click_position isn’t accurate as per the ground mesh?? as in i click on the ground but the Floor node is outputting a click_position value below the ground mesh, causing the cube to attempt to go through the ground, but collision is getting in the way causing stuttering? (probably overthinking it)
Any help would be extremely appreciated as I’ve been trouble shooting this issue ALL DAY and just want to move on with the project. Thanks in advance!