kidscancode / godot_recipes

Lessons, tutorials, and guides for game development using the Godot game engine.
MIT License
235 stars 38 forks source link

[Discussion] 2D: Multitarget camera #29

Open cbscribe opened 3 years ago

cbscribe commented 3 years ago

Discussion for http://godotrecipes.com/2d/multi_target_camera/

robwetz commented 2 years ago

thanks for all your videos/documents, @cbscribe! they're so helpful and appreciate your hard work. quick question on removing a target from camera. when i ran my scene using your example, i received: "Invalid type in function 'remove' in base 'Array'. Cannot convert argument 1 from Object to int."

i had to change targets.remove(t) to targets.erase(t) for it to work. is that okay? did something change since you made this document or is something wrong on my side? thanks!

cbscribe commented 2 years ago

Thanks for letting me know about this mistake. I've fixed the text to use erase().

PetitMote commented 2 years ago

Hi there, I’ve added the multitarget camera on my project (thanks for this). I had a problem of "ghosting" with my player whenever it was moving a bit fast. As a workaround, I placed the code in the _physics_process() loop instead of the _process(), that way movement from the camera is synchronized with the player movement. I don’t know if there is a way to tweak the code from the camera to keep it in the _process(), as it seems to me it would be a bit cleaner.