I want to make a simple first person car, just to move player from point a to point b. I dont want any wheel rotation or realistic engine features. I looked around and found Chaos Vehicle but it seems way too advanced for what i want to do. What would be the best way to do it?
Hey @30quickdead!
So what you’ll wanna do is this:
- Create a new pawn class BP as your vehicle
- Set up a new IMC for it
- Possess / Unpossess it to start / stop controlling it (It’s best to handle this inside the level blueprint)
You can check out this post of mine on the exact same topic
Or this one if you wanna spawn the vehicle instead of replacing the character.
Aside from replacing characters or spawning the vehicle, you can also just possess without spawning / destroying anything. (I’d still recommend destroying the player character tho)
And here’s a tutorial on interacting with a vehicle, if that’s what you wanna go for:
Let us know if you encounter any issues while implementing it to your first person project
Hope these help!
Do i have to add mapping context when i possess the vehicle again?
If you’re gonna have different controls for your vehicle and the player character of course. And don’t forget to remove the previous mapping context as well while doing so, I didn’t have that in the screenshot I included in my linked post because it was from an older post of mine.
Thanks, now i manage to get in and out of car and use inputs, but since i made this bp from Pawn it doesnt have any movement component, how can i move it? Also can i lock the camera to certain angles, like you cant turn completely to your back when you are sitting in car.
If the movement mechanics you’re looking for are the usual, I’d recommend checking out the vehicle template project.
If you have something else in mind tho, you can just add the floating pawn movement component and add movement input.