Car Always Spawns In Front Of The Character

Hello, I want to make a car that always spawns in front of the character, but I don’t know how I’d achieve that, any help would be great!

You could probably use CFrame lookvector of the player, then do something like this:

Car:SetPrimaryPartCFrame(plrCframe + plrCframe.lookVector * distanceFromCar)

obviously replace the variables with the relevant values and objects

1 Like

Could you explain what this would do? I’m new, and I’m looking for more on scripting

Car:SetPrimaryPartCFrame sets the position of the car
plrCframe would be the CFrame (coordinate frame, basically the position) of the player. Make sure to set this value

Then the lookVector * distanceFromCar
just adds distanceFromCar studs to the direction the player is facing

I’ll test this solution in a bit, thanks

Perhaps this could you assist you in some way.