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

toObjectSpace is not a valid member of Part

Asked by
Lineout 10
10 years ago
function Rotate(objects,center,new) 
    for i,object in pairs(objects) do 
        if object.ClassName == "Part" then 
            object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame)) 
        end 
    end 
end

When I call the function: Rotate(slayer:GetChildren(),v,"0,0,100")

Output: toObjectSpace is not a valid member of Part

  • Thank you to anybody who can help me*

1 answer

Log in to vote
1
Answered by 10 years ago

Rotate(slayer:GetChildren(), v ,"0,0,100")

Is 'v' called "Part"?

0
No, its called "Hover" Lineout 10 — 10y
0
Is that a part though? PiggyJingles 358 — 10y
0
Yes Lineout 10 — 10y
0
Try putting `center.CFrame:toObjectSpace(object.CFrame)` instead. PiggyJingles 358 — 10y
View all comments (13 more)
0
Now its saying: Players.Player1.PlayerGui.Control:13: attempt to call method 'toWorldSpace' (a nil value) Lineout 10 — 10y
0
Try `Rotate(slayer:GetChildren(),v,CFrame.new(0,0,100))` PiggyJingles 358 — 10y
1
:toObjectSpace expects a CFrame value, not a string. http://wiki.roblox.com/index.php?title=CFrame#Methods RaverKiller 668 — 10y
1
Rotate(slayer:GetChildren(),v.CFrame,CFrame.new(0,0,100)) 1waffle1 2908 — 10y
0
@Pig @Owen even went I turn it into a CFrame value, the output is: toObjectSpace is not a valid member of Part Lineout 10 — 10y
0
@1waddle1, I think your way works because it kills me and does not error, so thats good. Thanks guys! Lets just hope I can stop it from killing me(it's in a vehicle) Lineout 10 — 10y
0
Post the entire code please? PiggyJingles 358 — 10y
0
@Lineout :toWorldSpace also expects a CFrame, sorry I didn't clarify that. 1waffle's comment should work fine. RaverKiller 668 — 10y
0
@Pig: http://pastebin.com/wa30aBzQ Thats not ALL of the code because its 270 lines long but thats what I thank you want to see. Lineout 10 — 10y
0
Ok so when I move left, everything works but the vehicle and my character get destroyed.... Anybody know why? Lineout 10 — 10y
0
I don't even know what you are trying to do... PiggyJingles 358 — 10y
0
I'm trying to move a vehicle to the left, tis a hover craft -_-. When I move to the left, it like breaks all joints and then i dissapear. Lineout 10 — 10y
0
toObjectSpace should be ToObjectSpace (capital letter) - I had the same issue because I had misspelt it. ThePyooterMallard 0 — 4y
Ad

Answer this question