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

How to use CFrame without teleporting ?

Asked by 6 years ago

I'm making a sword (like the roblox's one)

I tried to change the Orientation of the whole sword so i used CFrame

It works fine but it teleport the player and the sword :?

game.Players.LocalPlayer.Character:FindFirstChild("Sword").Blade.CFrame = CFrame.fromOrientation(0,0,0)

2 answers

Log in to vote
0
Answered by 6 years ago

If you're trying to just reposition the sword alone you should go into the Tool and look for "Appearance". There you will find all the positions you'll need to edit the position and orientation of your tool.

Here's an image of what it looks like: http://prntscr.com/jozgib

You should also look into it on the wiki: http://wiki.roblox.com/index.php/API:Class/Tool

Ad
Log in to vote
0
Answered by
Link150 1355 Badge of Merit Moderation Voter
6 years ago

Moving a part by changing its CFrame property without affecting its orientation is easily done with

part.CFrame = (part.CFrame - part.CFrame.p) + newPosition

However, seeing how you're trying to manipulate a tool, I would suggest you look into the Grip property, as it sounds like you want to change the way the character holds onto the tool.

Answer this question