#Orientation Driving Bug

73 messages · Page 1 of 1 (latest)

tawny elm
#

Code:

if (script.Parent.Steer==-1) then
        script.Parent.Parent.Wheel_BackRight.Orientation = Vector3.new(0.001, 111.955, 0.001)
        script.Parent.Parent.Wheel_BackLeft.Orientation = Vector3.new(0.001, 111.955, 0.001)
        script.Parent.Parent.Wheel_FrontLeft.Orientation = Vector3.new(0.001, 111.955, 0.001)
        script.Parent.Parent.Wheel_FrontRight.Orientation = Vector3.new(0.001, 111.955, 0.001)
        script.Parent.Turn.angularvelocity=Vector3.new(0,TurnSpeed,0) 

        print("played all tweens, left")
    elseif (script.Parent.Steer==1) then

        script.Parent.Parent.Wheel_BackRight.Orientation = Vector3.new(0.001, -111.955, 0.001)
        script.Parent.Parent.Wheel_BackLeft.Orientation = Vector3.new(0.001, -111.955, 0.001)
        script.Parent.Parent.Wheel_FrontLeft.Orientation = Vector3.new(0.001, -111.955, 0.001)
        script.Parent.Parent.Wheel_FrontRight.Orientation = Vector3.new(0.001, -111.955, 0.001)
        script.Parent.Turn.angularvelocity=Vector3.new(0,-TurnSpeed,0) 
        --right
        print("played all tweens, right")

    elseif (script.Parent.Steer==0) then
        
        script.Parent.Parent.Wheel_BackRight.Orientation = Vector3.new(0.002, 0, 0)
        script.Parent.Parent.Wheel_BackLeft.Orientation = Vector3.new(0.002, 0, 0)
        script.Parent.Parent.Wheel_FrontLeft.Orientation = Vector3.new(0.002, 0, 0)
        script.Parent.Parent.Wheel_FrontRight.Orientation = Vector3.new(0.002, 0, 0)
script.Parent.Turn.angularvelocity=Vector3.new(0,0,0) 
        print("played all tweens, normal")```
#

ignore the tweens prints, it was when i added tweens for the orientation but it also didnt work.

merry mason
#

I'd rather work on quaternations that on those numbers

tawny elm
#

the numbers dont matter

dry fractalBOT
#

studio** You are now Level 2! **studio

tawny elm
#

its the fact the parts dont literally "rotate"

merry mason
#

what object is steer?

tawny elm
#

the vehicle

#

seat

#

steer the property

merry mason
#

`sec

tawny elm
#

alr

merry mason
#
workspace.VehicleSeat:GetPropertyChangedSignal('Steer'):Connect(function()
    
end)
```put all ur code between this
tawny elm
#

no the steer works

#

like "script.Parent.Turn.angularvelocity=Vector3.new(0,0,0) " works

#

and the prints

#

its the orientation

#

that wont change

merry mason
#

bro

#

try it

tawny elm
#

alr

merry mason
#

ur code will only run once

#

so having a function will run it when the function happens

#

when ur steering value changes, the code will run again

#

and will update

tawny elm
#

also i tried it and it broke

merry mason
tawny elm
#

oh no

#

theres more to it but thats js where the problem is

merry mason
tawny elm
#

lemme chek

#

they seem good

merry mason
#

alr so

#

show me the entire script

tawny elm
#

alr

#

ps i didnt write it my friend gave it to me and i js modded it with some stuff

merry mason
#

try changing cframe instead

#

with the position being empty

tawny elm
#

so like this

#

script.Parent.Parent.Wheel_BackRight.CFrame.Orientation = Vector3.new(0.001, -111.955, 0.001)

#

or cframe instead vector

merry mason
#

you could try ig

tawny elm
#

alr

#

lemme try that first

#

doesnt work

merry mason
#

eh I mean

#

life could be dream

tawny elm
#

whoel car broke by it didnt wokr

merry mason
#

I know it's not "pretend to be ur father" day but I'm leaving

#

gl tho

tawny elm
#

np

#

ty

reef heart
tawny elm
#

do what

reef heart
#

im trying to make a flying lambo from GTA

#

but i just made some torpedo thing

tawny elm
#

torpedo?

#

i dont play gta or take interest in cars

reef heart
#

it looks like a torpedo

tawny elm
#

show me pics

reef heart
#

im trying to make it fly

#
local seat = script.Parent
local Main = script.Parent.Parent.Main

seat.ChildAdded:Connect(function(x)
    if x.ClassName == "Weld" and x.Name == "SeatWeld" then
        p = seat.Occupant.Parent
        player = game.Players:GetPlayerFromCharacter(p)
    end
end)

local userinput = game:GetService("UserInputService")
local character = p

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.W then
        Main.Position = Main.Position - Vector3.new(0,0,1)
    end
end)

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.A then
        Main.Position = Main.Position + Vector3.new(1,0,0)
    end
end)

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.S then
        Main.Position = Main.Position + Vector3.new(0,0,1)
    end
end)

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.D then
        Main.Position = Main.Position - Vector3.new(1,0,0)
    end
end)

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.E then
        Main.Position = Main.Position + Vector3.new(0,1,0)
    end
end)

userinput.InputBegan:Connect(function(input, gameprocessed)
    if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.Q then
        Main.Position = Main.Position - Vector3.new(0,1,0)
    end
end)
#

@tawny elm

tawny elm
#

idk how to

#

script that good

#

im having problems myself with orientation lol

reef heart
#

this is simple it moves the Main which is an anchored thing

#

everything else is unanchored