I’ve tried getting this answered on the Answers Hub here: Swap camera onto projectile temporarily - UE4 AnswerHub
but so far nobody has been able to figure out why it doesn’t work. I’m hoping somebody here will!
I’d read the thread to get an idea what;s already been tried but if you can’t be bothered then I’ll summarise:
- To fire a projectile by spawning a destructible object when the left button is pressed - DONE
- Have the power of that projectile be determined by how long the mouse button is held down for - DONE
- Have a camera (a scene component of the projectile, on a spring arm) be set to the new view camera, and when the projectile is destroyed, swap back to the default camera - DONE
- Have the camera (a scene component of the projectile, on a spring arm) follow the projectile on it’s path to destruction - FAILED
So as you can see, most of it is done but the camera view (lets call it cannon-cam for ease) does not move with the projectile. It stays at the point of origin for the projectile rather than following it.
I’ve tried everything I can think of, from creating a new camera separate to the projectile and attaching it etc but nothing works.
If anybody could figure this out I’d be very happy. I don’t think I need to reinvent the wheel here, I have almost everything already in place except for the camera actually following the projectile.
Thanks in advance for any help, it will be appreciated.