Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CFrame and Orbit + Positioning Problem?

Asked by 5 years ago

Okay so, I've got a functioning Orbit script for a game, however whenever I use it the object seems to be teleporting back and forth from its original position or something...?

game.workspace.doublevisions:WaitForChild("Ultra-Fabulous Hair Brown").Handle.Mesh:Destroy()
game.workspace.doublevisions:WaitForChild("Ultra-Fabulous Hair Brown").Handle.OriginalSize:Destroy()
game.workspace.doublevisions:WaitForChild("Ultra-Fabulous Hair Brown").Handle.AccessoryWeld:Destroy()
local i = 1
local dist = 3.75
local spd = 100
local angle = 0
local this = game.workspace.doublevisions:WaitForChild("Ultra-Fabulous Hair Brown").Handle
local orbiting = game.workspace.doublevisions.Torso
while true do 
i=i+1 
wait() 
this.CFrame = orbiting.CFrame*CFrame.fromEulerAnglesXYZ(angle,i*spd,0)*CFrame.new(0,0,dist) 
end

Here's a gif to help understand: CLICK HERE FOR GIF

Don't know why it just fades into the floor like that...

0
My guess is that after destroying the welds, you need to anchor the handle part. I think its falling due to gravity - just a guess though. Another thing to try is use HumanoidRootPart instead of Torso as this wont move with animations. Protoduction 216 — 5y
0
Going to try the anchor, and thank you for the recommendation on the HumanoidRootPart :) doublevisions 3 — 5y

Answer this question