Hello fellow devs!
I have encountered a problem while trying to make a tween.
Here is my code :
local function road1(roadroller:UnionOperation)
local road = TweenService:Create(roadroller,TweenInfo.new(.2),{Rotation = Vector3.new(roadroller.Rotation.X, roadroller.Rotation.Y,15)}):Play()
end
The error : attempt to index nil with ‘Rotation’
Thought’s on how to fix this?
The only problem i see here is that the roadroller
parameter is nil
- Meaning that it doesn’t exists. Are you sure that the roadroller Object actually exists before calling the function or if you actually passed the Object as a parameter?
Yea. It does exist. I have checked multiple times.
Seems like the Rotation
property doesn’t exists on it… Maybe try using the Orientation
property instead of Rotation?
local function road1(roadroller:UnionOperation)
local road = TweenService:Create(roadroller,TweenInfo.new(.2),{Orientation = Vector3.new(roadroller.Orientation.X, roadroller.Orientation.Y, 15)}):Play()
end
Oh my god I am so sorry for making this topic turns out I didn’t send the roadroller to the function