mgear
5
you have 2 scripts, each one has their own target variable,
so your camera script doesn’t receive the target.
2 options:
- in your OnMouseDown script, send the target to your camera script (search for:unity access variable from other script)
- use the raycast way, in your camera script (then raycast hit will return current target)
for pasting scripts to forum, use this way, easier to read: