Change camera angle when hitting the collider.
Hello, I need to make my camera change angle when it's in a certain place, like Mario 3d world. Example, when I go to another obstacle, the camera distance a little and angle changes, I think I should use a collider to know when to change the camera angle. But I do not know how to do it in the Blueprint. (Do not change camera, just angle, distance) thanks for the answers!
asked Jun 07 '17 at 03:42 AM in Blueprint Scripting
Make an actor that has a single collision volume and a rotator and a scalar in it. Set these variables manually. Then, from the event OnBeginActorOverlap you cast to the character class and if successful you call a function in that character class called SetNewCameraAnglePos (or whatever you want) and send in the rotator and scalar you stored.
Inside the SetNewCameraAnglePos function you set the angle of the camera and the distance of the camera based on the rotator and scalar.
Alternatively you can just return a vector that acts as an offset vector that you add to the character to get the new camera location. It comes down to how you have made the character really.
answered Jun 07 '17 at 04:39 AM
Use a 'spring arm' component inside your character blueprint and attach the camera to it just like the one in the third person template. You don't need to do any coding for that. Remember that the obstacles must have a collider with the camera component.
Follow this question
Once you sign in you will be able to subscribe for any updates here