How to set a 3D camera to follow 2 targets

Godot Version

Godot 4.2.2

Question

hey hey im making my first 3D game, and i recently started my prototyping


i want the camera to follow the player while keeping the enemy in sight
how can i do that? (i appreciate explanations/links to documentation)

Use phantomCamera extension. It has this feature built-in, and you can download it from the in-editor asset store. It also has easy docs online, I would recommend checking the follow mode article.

1 Like

omg i will be checking this out, thanks

1 Like

Heres the docs:

Phantom Camera docs

1 Like

Does this work for you?

1 Like

HI yes it works! it gave me a head ache to get it working but after digging for an hour i figured out how to stop all the warnings i got

so right now im trying to figure out how to make the camera zoom in and out to keep both targets in sight instead of just rotating

it still didnt work the way i want it too but i wanna keep using this add-on as its a life saver, i didnt wanna bother and ask and try to figure it out myself. but if you have any suggestions it may help

1 Like

this is what it does when i get them apart

1 Like

Sorry, I don’t have any sure-fire suggestions since I don’t work a lot in 3d, but it seems that the auto_follow_distance and related variables like auto_follow_distance_min and auto_follow_distance_max could be what you’re looking for.

no prob, i will continue to do trail and error and try the vars you mentioned somehow figure it out on my own
anyway thanks man, i wouldnt know about this addon if you didnt mention it.

if i figure it out i may make an update cause it may save someone else the trouble.

also omg im actually considering going 2D (lmao) cause ive more familiar with it, but 3d saves me the huge amount of drawing i will have to do :sob:

okay okay
image
i looked at the provided examples and looked for vars and it works! the camera is working the way i want it to
thanks so much bro, my other reply i did 30 minutes ago is yet to be approved ahahah
its all good now thanks

if anyone who looks at this where you have the same situation as mine use the 3d_follow_group_example_scene as reference

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.