The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Hey so I can't figure out what will the timer be to set the camera smoothing speed into default, like for example i died because of a spike or void, my code will set the position of the kinematic body into my spawn point but I don't know what the timer of my yield would be. so are there any way to determine the time?

The Problem Video

func _on_Area2D_body_entered(body):
if body.name == 'Player':
    is_alive = false

    anim.play("Death")
    yield(get_tree().create_timer(2.3),"timeout"); cam.smoothing_speed = 2

    position.x = -168
    position.y = -9

    is_alive = true
    yield(get_tree().create_timer(?????????????),"timeout")
    cam.smoothing_speed = 5
Godot version 3.4.4
in Engine by (18 points)
edited by

whatever time you put on the yield will only delay triggering the rest of the code. The smoothing speed will remain at 5. Not sure what you are asking. What is that you want to achieve? determine the time for what purpose?

Im setting the smoothing speed to 5 to make it default so it'll not stay as 2 smoothing speed which my code changes above.

so basically i want to predict how much time the camera will go back to player position which i will use to create a timer to set my smoothing speed to 5

Not sure if i explained it correctly but im stuck on this problem since yesterday lol

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.