Conversion of autonomus vehicle to manual vehicle using blueprints

I’m trying to create a conversion of autonomous vehicle to manual vehicle.

I have designed an autonomous vehicle blueprint with a spline path.
My question is, How I can convert the same autonomous vehicle to a manual vehicle while the autonomous vehicle follows the spline??

Hey @Mkrik!

Can you you explain a bit more what you mean by making the vehicle manual and autonomous at the same time? What part of the vehicle will become manual if its still following the same path?

Any additional specifics you provide will go a long way in solving your problem!

Hello @Quetzalcodename

Thank you for your response.

Sure, I have already designed the blueprint for an autonomous vehicle.
My project requirement is, after the game starts the autonomous vehicle follows the spline path and after 15 seconds user press the H button from the keyboard that breaks the path and convert the vehicle to a manual configuration at the same location.

#What part of the vehicle will become manual if its still following the same path?

-Streeing
-Throttle

Below is the autonomes vehicle blueprint:-

I have tried one solution with coversion of two vehicle:-

1.BP_autonomous
2.BP_Manual

You can see the below screenshot:-

But it has two issues :-:

1- The flip-flop node is not working correctly means that after the user presses the H key the control switches to the manual vehicle but if the user again presses the H key nothing will happen.

2- I am not able to find the solution to put the manual vehicle on the same location as autonomous vehicle after the user presses the H key

Do you have any solution for this?

Hey @Mkrik,

I see that you are not casting to your vehicle, which may be the issue you are running into. Check out this non-Epic affiliated tutorial for possessing a vehicle that may help you set your controls correctly:

Hey @Mkrik!

Checking in! Were you able to solve your issue? Was the above the solution you needed?

Hello @Quetzalcodename ,

I am still struggling with the both issues.

1- The flip-flop node is not working correctly means that after the user presses the H key the control switches to the manual vehicle but if the user again presses the H key nothing will happen.

2- I am not able to find the solution to put the manual vehicle on the same location as autonomous vehicle after the user presses the H key.

Could you guide me in this blueprint, How I can cast the vehicle?

Also, do you have some idea about second issue?

2- I am not able to find the solution to put the manual vehicle on the same location as autonomous vehicle after the user presses the H key

Basically, I want to make a Parent child relationship. The Parent is autonomous vehicle that flows the spline path and the child (manual vehicle) flows the parent .When the user press the keyboard key the control switch to child object i.e manual vehicle.

What blueprint is the screenshotted logic in? Because, for example lets say it was in BP_CarA…

When you press H to Flipflop and you currently are possessing BP_CarA, sure it will work, but because you stop possessing BP_CarA and are now possessing BP_CarB, pressing H no longer does anything…

I’m obviously making an assumption here that your logic is inside one of your cars/characters. If that is the case, put this logic inside a player controller. Which will possess a pawn (Car) but still be the player controller and have access to the code…

As for your second query, have you tried casting to the autonomous vehicle > get actor transform then casting to your manual vehicle > set actor transform (using the value you get from the autonomous vehicle) ?

Also, event tick is probably going to cause you some issues down the line. Better to use a timed custom function.

Hi @ruigol

Yes, your assumption is correct. I put this logic inside BP_autonomous vehicle.
Player Controller you mean to say, I need to put this logic inside level blueprint?

Second part :- Should I make a casting in Autonomous vehicle??

No, in your gameplay level, in the world settings, add a player controller. Put the logic in there.

For wherever your logic is that stops being one type and starts being the other (with the flipflop) you indicate that the spawn location is not in the same place, I am just telling you how to get the location of one thing and set it as the location for another :slight_smile:

I am able to put the manual vehicle at the same location as the autonomous Vehicle with the help of this link:- https://youtu.be/5cRlIuGVx-U

Now, one more thing I want to do, once the vehicle is changed to a manual it must be in moving condition like autonomous. Or How I can replicate the speed of the autonomous vehicle and set it to a manual vehicle??

I would reccommend you to download the sample car project/template and have a look at the code in the cars BP. It sounds like you want to possess a vehicle that is “drivable” by the player as opposed to the spline moved vehicle. I reccomend you destry the splie vehicle and spawn a drivable car (like in the template) in its location.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.