I’m using the modular vehicle system and, as such, use Set Input Axis 1D (Throttle) to control vehicle drive. This works absolutely fine when on a player-controlled vehicle, but not for an AI-controlled vehicle.
I’ve tried putting this on the vehicle blueprint itself as well as on both an AI controller and a player controller that possess the pawn on spawn, but still no luck. If I posses this same vehicle blueprint with a player controller, it works fine.
I did have this working a while ago, but I can’t seem to work out why it won’t work now.
I was just adding it on tick for testing purposes. I did have additional logic for the AI driving the vehicle, but to keep things simple and make it easier to work out what the problem is, I put it directly on tick with no other logic. I haven’t had any luck with working out why it’s not working though
If I possess this pawn with the player instead, the tick setting the throttle works absolutely fine with no changes. I just don’t seem to be able to get it to work any other way
I see. I’m sorry then I have no idea what can be the problem. Anyway actually and luckily, there are some user here that probably will be able to help you, just give them some time to see your post
I still not tested her in unreal, and this can be a great excuse to see how “smart” she is. Luna answer after se all the conversation:
PROBLEM:
Set Input Axis 1D (Throttle) works with PlayerController but fails with AIController.
───
ROOT CAUSE:
You’re using Event Tick (continuously at 60fps) to call Set Input Axis 1D, which:
• Fires repeatedly every frame
• AI Controller doesn’t have Vehicle Component ready at startup
• Timing mismatch between Controller possession and Component availability
───
CORRECT SOLUTION:
Change from:
Event Tick → Delta Seconds → Set Input Axis 1D
To:
Event Possess (Pawn) → Set Input Axis 1D
Or alternatively:
Event BeginPlay → Set Input Axis 1D
───
IMPLEMENTATION STEPS:
In AI Controller Blueprint:
Open AI Controller Blueprint → Event Graph
Add Event Possess (Pawn) node
Cast AI Controller → Chaos Vehicle Controller
Get Vehicle Sim Component
Connect to Set Input Axis 1D
• Target: Vehicle Sim Component
• Name: “Throttle” / “Steering”
OR in Vehicle Controller Blueprint:
Open Vehicle Controller Blueprint
Add Event BeginPlay or Event Possess
Connect directly to Set Input Axis 1D
Set Target and Name parameters
───
KEY PRINCIPLES:
Once only - Set Input Axis 1D runs once at initialization
Timing right - Must happen after AI Controller possesses Vehicle Pawn
Correct Event - Event Possess or Event BeginPlay, NOT Event Tick
───
NEXT STEPS:
Do you want to:
See step-by-step guide in Blueprint editor?
Verify your Cast To is correct?
Check that you’re using Event Possess not Event Tick?
This one looks like they’re focusing on trying to just fire Set Input Axis 1D only once, on an event like Begin Play, but I would need to be firing it often based on either player or AI Controller input.