godot_recipes icon indicating copy to clipboard operation
godot_recipes copied to clipboard

[Discussion] 2D: Multitarget camera

Open cbscribe opened this issue 4 years ago • 3 comments

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

cbscribe avatar Feb 03 '21 02:02 cbscribe

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!

robwetz avatar Jan 23 '22 00:01 robwetz

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

cbscribe avatar Jan 29 '22 22:01 cbscribe

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.

PetitMote avatar Aug 19 '22 07:08 PetitMote