So im trying to make a hovercraft wobble but it wobbles to much.
Help is appreciated!
So im trying to make a hovercraft wobble but it wobbles to much.
Help is appreciated!
A cursor examination of the code:
if rotated == true then
cframe = cframe * CFrame.Angles(0,0,150.5)
rotated = false
else
cframe = cframe * CFrame.Angles(0,0,145)
rotated = true
end
CFrame.Angles takes radians, not degrees. Try converting these into radians before passing them in.
if rotated == true then
cframe = cframe * CFrame.Angles(0, 0, math.rad(150.5))
rotated = false
else
cframe = cframe * CFrame.Angles(0, 0, math.rad(145))
rotated = true
end
Note you also have multiple tweens going at once. I wouldn’t use tweenService for this.
If you can clarify what wobbling means, that would be useful
like slowly going from side to side.
i cant do anything else to move it up into the air as thrust will not work because of your welding script as thrust does not work with welds and if i changed the surface types it would ugly so the only way to move it into the air is tweenservice.
Have you considered using a VectorForce or AlignPosition physics constraints to make it hover?
no idea how to do that xD
Check out the wiki!
do they work with anchored parts?
Nope! It’s a physics constraint! Vehicles shouldn’t be anchored!
how would i keep the parts together then?
Through welds! My weld script you mentioned can get the job done (although it’s a bit out of date).
Start with the parts anchored.
Take a look at some other free model vehicles. Those are welded too! You can also pre-weld models.
lemme try it out.
Using a weld should work, and then like @Quenty said, use a physics constraint to make it hover. I don’t have a good knowledge base of physic constraints so I couldn’t help you with that, sorry!
not working…
while true do
local part = script.Parent.Main
local ray = Ray.new(part.CFrame.p, CFrame.new(0,part.CFrame.Y-500,0).p)
local hitpart, position = workspace:FindPartOnRay(ray, script.Parent.Parent)
if hitpart then
local attachment = Instance.new("Attachment",hitpart)
attachment.Position = position
part.VectorForce.Attachment0 = attachment
wait(0.5)
attachment:Destroy()
else
wait(0.0001)
end
end
Try using the Wiki or Youtube, because I honestly have no idea.
wiki has no tutorials nor does youtube… its a very untouched subject.
Try just playing with the constraint in studio without any scripts.
You can just adjust the attachment position.
works fine with normals parts but does not move the hovercraft at all.
i have no idea why…
You’re trying to set the attachment’s position to a world position when attachments use object space.