Can't get my possessed car to move...

Hello everyone, maybe this is a common question but I’ve started a Third person game and followed this Tutorial (Click to see tutorial)

So I was able to import the car pawn and then possess it, but when I try to move the car nothing happens… not sure if this is a common rookie mistake, but I’ve searched and tried every solution I could possibly find and code but yet I’ve not been able to make it happen.

So far I think the issue comes from the VehiclePlayerController Blueprint, I got to this conclusion from the error message log, when changing the game mode to VehicleAdvGameMode.

Thanks in advance for all the help!

Hey there @Pablobailey! There is a number of reasons your car isn’t reacting. Most commonly it’s due to inputs. What version of unreal are you using and are you using the enhanced input system or the old input system?

Similar thread below:

1 Like

Thanks for the reply! Im using Unreal 5.1.1 and yes I am using the Enhanced input system.

I read that similar thread before and I tried the solution but had no success… Not sure if I’m doing something wrong with the level blueprint.

Well it seems like it’d probably be best to just see how you set it up, and we can correct it! Also, are the tires spinning? Put some print statements to see if the inputs are going through at all. First thing we need to do is verify inputs are happening, if so we can narrow down where the error stems from.

Hey! good news I finally got the car moving, I used the solution provided in the thread you posted here.

Turns out I wasn’t referencing my Third person character correctly on my level blueprint.

Now that the car is moving, wheels are not spinning, do you happen to know why this could be?

Fantastic! Your wheels not spinning could be related to how you imported the vehicle. Did you also import the Animations and AnimBP? Does the AnimBP still look like this?

Is it connecting in the vehicles BP?

If so, when you press play with the vehicle AnimBP open, does it show the execution lines working?

Sorry to be so noob but yeah, definitely I did not Import the animations, I was searching for them but couldn’t find them, Would you know where can I find them so I can import them?

You can likely migrate the rest of it over from the template the same way you did before, you just might have to hook it back up, here’s the folder:

Ok so I routed the Animation Rig blueprint in the SportsCar_Pawn on the details section.

Then I went to the skeletal mesh to see the names of the bones that where on the wheels.

Then I went over to vehicle movement component and in Wheel setups I routed the wheel class (SportsCar_WheelsFront and SportsCar_WheelsRear) and Bone names respectively for each of the 4 wheels starting from FL, FR, BL, BR.

This resulted in wheels spinning, however, they are very glitchy, they seem to be active sometimes and then only the back ones work, anyways, very glitchy tires hahaha.

But I think I’m getting there, is there something else you might suggest me trying?

image

image

image

image

You’re on the right track! I’d take a look at the docs on how to set the vehicle up and see if you’ve done the required bits for the animation portion and it should also help verify you have all of the components:

Hi there!
I started up the VehicleExampleMap level, and while all the Blueprints (both input and animation) seem to be present and built correctly, the car does not respond to any input from either the keyboard or my connected gamepad controller.

Is there something obvious I’ve overlooked?

Hey there @KHPutnam! Is your actor receiving the input at all or just not acting on it? Are you using the enhanced input system or the older one?

I’m using Enhanced Input (engine v. 5.2.1).
I’ve noticed that in the pre-built blueprint for the SportsCar_Pawn there’s no Get Controller node anywhere. Perhaps that’s the issue?

Get controller node actually just gets a reference to the player controller, and doesn’t do anything other than that on it’s own. What attaches your controls is this node and it’s inside of the vehicles player controller itself:

The reason I’d asked if it was receiving any of the input actions is if not, it could either have not been possessed at the start or this wasn’t setup in the player controller.

(assuming you’re using the default input actions) If you place a print node after one of them, for example IA_throttle here:

image

Does it print? If not, we need to verify if your car is ever possessed.

Putting this on your BP will print if you possessed the vehicle when it starts (it’s usually clear but you can always verify)

image

and does that print when the game starts?

If both of those print and the car doesn’t react, then we’ll have to debug the vehicle itself and that will get a bit more fun.

Thanks so much for your detailed help.
The Print String attached to Event Possessed does report that the car pawn is possessed when I enter the game. It prints the possession report twice, in fact.
However, the Print String attached to EnhancedInputAction IA_Throttle does not report anything when I press any of the defined throttle buttons.

In your first blueprint graphic, should I assume that the output of the Add Mapping Context node connects to the input of the Cast To ChaosWheeledVehicleMovementComponent node which starts out connected to the output of Event BeginPlay before I create and connect the Enhanced Input Local Player Subsystem and Add Mapping Context nodes (which aren’t there in the SportsCar_Pawn BP when I open it in the editor)?

Here’s how I connected it up after creating the nodes (ignore that the Mapping Context isn’t set in this example):

ETA: is it possible that inputs are bugged in 5.2.1? I was watching a tutorial using the same vehicle demo level where the input controls “just worked” upon first load, but they were in engine 5.1.

So the Vehicles template on 5.2.1 is fully setup input wise to drive as soon as you launch it and press play in editor. So something else must be causing your inputs not to land.

So the input context I showed off is (supposed to be) already in the default player controller, in your case it looks like you put it inside the vehicle itself, it shouldn’t require this due to being a child of the player controller when in game, so you can revert the vehicle BP to the way it was before!

Though your answer here gives me a solid hint of where your issue may be:

It prints the possession report twice, in fact.

Did you by chance place a vehicle into the map? As the game mode (as it begins normally) spawns it’s own at the player start location. So you may in fact have one you placed and one that’s spawned.

For example:
image

This spawns one car and the other just sits in the world. It takes possession first, then the spawned one takes possession one tick later.

Okay, interesting.
Hypothetically, then, if I start totally fresh with a new, untouched VehicleExampleMap in 5.2.1 the inputs should “just work” immediately, the first time I press Play, right?

Except they don’t. So I’m clearly missing something… Both my keyboard and my gamepad are recognized by UE; I can bind keymappings by clicking the appropriate key or button on either input device.

I’m feeling a bit crazy! :slight_smile:

Ahhh that’s extra interesting! I’m feeling the same! I spun up a project just to verify the 5.2 update didn’t break input for the vehicle template, and it worked out of the box so I’m unable to replicate. So time to get digging!

May I know your specs?

Are other default project types working out of the box?

Do you have an input layer such as DS4Windows or Joypadder active?

If you remove the gamepad do the keyboard inputs work appropriately?

In project settings, is this set to Enhanced Input?

Do base inputs work on the vehicle?

Thanks for hanging with me here.
Specs:
Windows 10 Pro v22H2
Intel i9-7900x 3.3 GHz
32 GB RAM
Radeon RX Vega GPU

Default projects in 5.2.1 which are also not accepting input out of the box: Third Person Template, First Person Template, Top-Down Template.

This is both with and without the gamepad connected.

Not using DS4Windows or Joypadder

Yes, in all projects Input → Default Classes have both options set to Enhanced.

I added the node structure you suggested above to the SportsCar_Pawn Event Graph, and no, pressing the keys when in Play mode does not print the strings to the editor.

Uh… hang on, something odd happened.
I went into Play mode one more time and randomly decided to first use mouse right-button hold to look around and suddenly the keyboard and gamepad inputs all started working.

This is great, BUT, I’d like to understand why I need to “wake up” the inputs by first using the mouse look-around.