[SOLVED]A better way to handle smooth movement + rotation

Sorry, I wasn’t sure how to word this topic properly. I’m trying to make it where blades can follow the player while being rotated smoothly by the mouse position.

As shown in the video(I apologize for the poor quality), I have one blade that is using the blade movement script(Blade stuck to my torso) and one without(blade suspended in the air). My problem is, I want the blade with the script in it to be able to follow the player smoothly while being able to rotate it base on mouse position. However, the script within the blade is competing with the script that’s using the blade rotation event. Both scripts are provided below.

I tried having it move based on the HumanoidRootPart.Changed but that only caused further problems so I went back to having it get the primarypart’s CFrame.

Video: https://i.gyazo.com/8f5fa9714eeb8bd924dcef7f501c8896.mp4
MoveSword.lua (151 Bytes)
Script.lua (248 Bytes)

1 Like

What I would do is create a invisible 1x1x1 part that smoothly moves to the player’s position using TweenService, use a motor6D to weld the sword to the invisible part and use TweenService on the sword as well.
Not sure if it’s the best way but I think it will work pretty well.
Get the swords offset from the nvisible part so you can set the C0.

I think it was:
CFrame1:Inverse()*CFrame2
Not sure though, but that way you could get offsets from 2 positions.

Hmm I see. That does seem like a good idea. I’ll give it a try. Thanks for the suggestion.

My friend you are a god send. The only thing I really needed to do was add the motor6d and give the parts a bodygyro + position, but I thank you for giving me the idea in the first place.

You’re welcome.
Make sure to mark it as a solution,
I’m here to help with what I can and know.
Edit: Oh you already did, didn’t saw it. XD