Spa_rkk
(Sparkk)
May 19, 2022, 9:34pm
#1
I want to change the rotation of my part but only on the x asis any help?
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
db = false
Mouse.Button1Down:Connect(function()
if db == false then
db = true
script.Parent.Handle.Shoot:Play()
wait(0.1)
script.Parent.Handle.Orientation = Vector3.new(10, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation = Vector3.new(30, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation = Vector3.new(10, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation = Vector3.new(0, 0, 0)
wait(0.5)
db = false
end
end)
whats the problem? char limitation
Spa_rkk
(Sparkk)
May 19, 2022, 9:35pm
#3
No just I need to change a rotation but only on the x axis without changing the y and x axis.
is your script running? because in your script your changing the x axis
Spa_rkk
(Sparkk)
May 19, 2022, 9:39pm
#5
ONLY CHANGE THE X AXIS, not making the others set to 0
you could change the β=β to β+=β
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
db = false
Mouse.Button1Down:Connect(function()
if db == false then
db = true
script.Parent.Handle.Shoot:Play()
wait(0.1)
script.Parent.Handle.Orientation += Vector3.new(10, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation += Vector3.new(30, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation += Vector3.new(10, 0, 0)
wait(0.1)
script.Parent.Handle.Orientation += Vector3.new(0, 0, 0)
wait(0.5)
db = false
end
end)
instead of vector3.new(10,0,0) use vector3.new(10,nil,nil)
adding onto this, iβd suggest using β*=β instead since if you enter negative values in the vector3 and vice versa it will subtract instead of just adding
F0xBirdmansBFF:
vector3.new(10,nil,nil)
that does the same thingβ¦
but it doesnt? vector3.new(10,0,0) sets the vectors X,Y,Z. however vector3.new(10,nil,nil) sets only the vectors X
try this for yourself, make a part in studio and run the following code:
game.Selection:Get()[1].Position = Vector3.new(10,nil,nil)
this is what happens:
The default parameters for the Y and Z components would be 0 nonetheless, so it is a bit redundant.
1 Like
Spa_rkk
(Sparkk)
May 19, 2022, 9:59pm
#12
Im going to remake this a different way thanks anyways!