Good morning developers !!
I’ve been trying for a while to find a solution to this problem, which is that I only modify the LookVector but it goes to the corner of the map, this is my script:
local Services = {
Players = game:GetService("Players");
ReplicatedStorage = game:GetService("ReplicatedStorage");
};
local RemoteEvents = Services.ReplicatedStorage:WaitForChild("RemoteEvents")
local DriveVehiclesRemote = RemoteEvents:WaitForChild("DriveVehicles")
DriveVehiclesRemote.OnServerEvent:Connect(function(Player, Car, DirecctionX, DirecctionZ)
local PrimaryPartCar = Car.PrimaryPart
PrimaryPartCar:SetNetworkOwner(Player)
local BodyPosition = PrimaryPartCar.BodyPosition
local BodyGyro = PrimaryPartCar.BodyGyro
BodyPosition.Position = PrimaryPartCar.CFrame.LookVector * DirecctionZ * 5
BodyGyro.CFrame *= CFrame.Angles(0, math.rad(DirecctionX), 0)
end)
This is the result:
Any solution?
