that is actually pretty cool
What do you mean?
still tweaking lots of stuffs but need my player to rotate smoothly though
Probably that’s a variable that’s used in another game or example, but not in your project. In your project it didn’t exist and that’s why it gives the error of ‘undefined’.
Yeah that makes sense, gotta be more careful next time, although that smooth rotation is not working at all, got no error but neither got my function working
So what is happening?
no clue, i would rather use math lerp it is also easier to understand, now i have no idea idea what is happening inside
What is happening outside?
He is not rotating towards points i defined.
if i use simple lookat it is rotating good, but with no smoothnes.
Why do you call lookAt() in 2 different methods in the same update loop?
i turned off lookat in followpath when i was testing lookat in smoothLookat
either way lookat works only in followpath
Where is the tween?
if you mean tween.js then it is in my script folder in project
You realise you are calling smoothLookAt() every frame?
Please read the manual.
Calling a smooth rotation tween every frame is not what you want. You should call the tween once when the event happens
You are right ^^
Something is happening now, but it is not really what i want
it is behaving really awful
To be honest, I never managed to get smooth rotation with tweening. I therefore use a different method.
Might be a slightly different use-case but this works butter smooth for my camera rotation:
var exitDurationSeconds = 7.0;
this.tweenRotation = this.mainCamera.tween(this.originEntity.getLocalEulerAngles()).rotate(this.targetEntity.getLocalEulerAngles(), exitDurationSeconds, pc.Linear);
this.tweenRotation.start();
I think its not time for me to use tween library yet