Making camera jump to player instantly. #229
Replies: 2 comments 4 replies
-
If you have the tween_on_load_on.mp4
tween_on_load_off.mp4
Both examples are using a default tween resource, but changing it didn't affect the result. My only guess would be that it's the |
Beta Was this translation helpful? Give feedback.
-
I managed to fix it by doing the same wait for 2 frames and switching the damping off and on. public async void FixCameraTween()
{
// Going to hell for this
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
PhantomCamera.Get("tween_parameters").AsGodotObject().Set("duration", 1);
PhantomCamera.Set("follow_parameters/damping", true);
} probably not the best way to do it but it works for now? |
Beta Was this translation helpful? Give feedback.
-
When my game starts, the player is randomly placed into the level and the camera is set to follow it. The problem is, that the camera has to tween to the player from its starting point, this technically happens post load, so the tween on load option doesn't seem to affect it. is there a way to skip the tween at any given moment? I'm using CS but the general idea should be shared across languages.
This is my current code. my thought was to set the tween time to 0, wait a frame, the set it back, but it doesn't work, any ideas?
Beta Was this translation helpful? Give feedback.
All reactions