How can I make a free-look camera for a vehicle?

I’m trying to make the vehicle have a free look camera instead of fixed, as it is now I can only see whats in front where the vehicle is facing, I’d like to have it like in car games where you can move the mouse all the way around looking up down side to side & back, a complete free look.

I tried using the same mouse input nodes from the 3rdperson MyCharacter blueprint for the Sedan blueprint but it won’t let me add or search for the InputAxis Turn or anything with “turn”

I set up the 2 inputs in the engine input settings (Look X and Look Y) already though

How can I setup a free look for the vehicle sedan blueprint?

Hey CyberDev,

To get a free look camera all you need to do is go into the “Components” tab of your vehicle blueprint and then select the “Spring Arm” from the list, now down in the details panel turn on “Use Control Rotation”. Save and compile and you should be able to look freely around the vehicle.

To go a step further and create a camera that snaps back to behind the vehicle when not moving the controller thumbstick or the mouse, I actually just answered this question for someone on the forums with all the details, rather than type it all out again, have a look here, it has images of the setup and how to get it working.

If you have any questions please let me know. Hope that helps!

Maybe I dont have the correct definition of free look, but checking “use pawn control rotation” still keeps the camera in one fixed place behind the car, only the car can freely rotate now.

So in order to be able to rotate the camera around the car, should I duplicate all the blueprints you posted for the resetcamera view? I see there are Camera yaw & pitch axis mappings, so I guess that is what I’m looking for?
I havent used blueprints much I’m mainly a modeler/texture artist, I guess this is a good time to learn,
Unless possibly you could share your blueprints / project for this?
Have they implemented that where you can share and copy paste blueprints with others easily like you can do with code yet?

If not, thank you very much for the answer either way!

if you haven’t already, you will need to add these event handlers to your blueprint to tell it how fast and smoothly the camera should rotate.

Add the following nodes after you LookX (mine is called Camera Yaw) and Look Y (mine is called Camera Pitch), shown here:

With these setup as shown, you should now have full working camera that will orbit around the car, just make sure the Springarm’s “Use Control Rotation” setting is checked, as well as Inherit Pitch and Inherit Yaw.

Compile and save and test.

The nodes I linked you to are for getting the camera that can rotate around the camera to move back to the default position directly behind the vehicle, so it does not get stuck always looking at the car from the last angle set before releasing the mouse/gamepad thumbstick.

You don’t need the second part to get this working, just make sure you are able to look freely around the vehicle before moving on to that section. :slight_smile:

Wow your the best thanks!
I didnt know how to get the Camera Axis Rate node for 80.0
I searched for variable and float integer etc
So I just put 80 in the left middle pin of the multiply node

The pitch I think is the opposite of what most games are, that was odd at first,
Is there a way to reverse it so moving the mouse down will make the camera look down instead of up?

Edit: Fixed it by settng the Look Y scale to -1 in the Engine input settings!

1 more question:

Is there a way to prevent the camera from going through the terrain when Im looking up?

Really appreciate it!

Hey man,

Double check your spring arm settings in the Components Tab, these should be turned on:

With the “Do Collision Test” option enabled it should work properly, but if not try increasing the Spring Arm length by 100 or so and see if that helps.

and make sure the camera is set up like this (EDIT: I had the arrow pointing to the wrong setting, this is the one that needs to be off):

Aside from that it should work properly, but post a screenshot of the issue so we can see what’s going on if that doesn’t fix it for you. :slight_smile:

Ah the camera was far away from the spring, I had to set the camera X location to 0 and then adjust distance based off the spring like you said to fix it! Thanks!

Also, if you are still here I have another question about mass & GTA style physics. With the stock example vehicle, when I’m jumping off of a ramp it doesnt seem to roll or have proper physics like gta cars do. It does roll and land upside down sometimes, but its not really smooth and arcadey and it just seems kind of bad,
I read through teglegs thread called “horrible car physics” and it was interesting, but
I also remember that APB:Reloaded had pretty good physics for doing jumps and the car would have smooth weight & roll in mid-air nicely like GTA, and that game was made with unreal 3.

Is there a certain setting I can change to have better gta style physics when I’m going off of ramps instead of how it is now? It just clunkily rolls and the center of mass or something is making it not great

Is there a way to like change the location of the center of mass or something? It seems like when the car rolls its rolling around a point thats on the bottom floor of the car, so in mid air and when crashing from a jump it rolls based off this point,
Instead it should be flipping and rolling from a point thats located inside the middle of the whole body,
Im not sure if this makes sense, but is there a way to fix what I’m talking about?

Hey CyberDev,

There was an issue with the COM offset for vehicles that was just recently discovered by Mike Skolones from NVIDIA & Ori Cohen at Epic, it has been fixed now for version 4.6 (which should be out very soon).

So that should be better in the next version, Mike has been doing a lot more investigation of the current setup and has found a couple of other small issues, if you’d like to read up some more on this there is a discussion going on in the second page of the link provided above.

The fix is already in the Github build of the engine if you want to try it out now as well. :slight_smile:

Also one quick note on that, you can also change that back to 1 and then go into the advanced options below and invert that axis for the Mouse Y & Gamepad Right Y like this:

Either way will work just fine.

I downloaded the 4.6 preview from the launcher and made a new vehicle project but it still seems pretty bad when coming off of a jump, the floor of the car is still behaving like a magnet where its not rolling around a point from the middle of the center of mass of the whole car in the air, it still rolls based off a point of the floor of the car

Or is it fixed in a newer version thats not in the launcher and I have to manually get it off github?

I noticed the center of mass values have been enabled though so I can change the xyz values but I’m not sure if that helps, I tried putting in different values for each axis but it doesnt seem to change how the rolls when coming off of a ramp in the air it still seems to be rotating around the floor of the car and not around the center
Unless there are specific values I should try for the com offset?

Have you guys checked out Edys vehicle physics for unity? It has amazing car physics, try the sedan out and jump off a ramp, but yet it says it uses physx as well so physx cant be the thing holding this quality back for ue4 right?

Edys Vehicle Physics

Hi,

Sorry to hijack your question, but mine is near-enough the same!

I’ve run into a few problems with setting this up! I’m using the default vehicle gamemode, and I can’t seem to get my BP set up the way you’ve setup yours here; forza controls ? - Blueprint Visual Scripting - Unreal Engine Forums

This is what mine looks like currently:

As you can see, with the Mesh I’m not able to get the three return values. I’m guessing I’ve missed something? I’m a complete novice to BP scripting, however a third person camera is something I’m in need of just to showcase the exterior of the vehicle I’m driving!

If you could provide any help in a dumbed down way of explaining it that would be appreciated. All I’m trying to achieve is a third person camera, I’m not too bothered about it returning to it’s original position.