Keep the part near the other part while rotating

Hi everyone

Um, video should explain better what i want to achieve

What I have:

What I want to achieve:

Just like in any Tower Defense game
I don’t want to make an union because I need the gun for other stuff

I just want to keep the gun near the guy when rotating

You can either use welds which is so much simpler or you could just rotate the whole model. With model:SetPrimaryCFrame(). You can also look into CFrameMatrix

2 Likes

That happens when i use welds (same with SetPrimaryPartCframe)

May we see the code you are using.

And that’s the problem, I’m not using any code because idk how to do it and I want to know the code that allows me to do what I want to achieve, to stick the gun to the guy

Ok. So can you do a screen shot of the model in the explorer so we can see how its constructed.
It might be you are setting up the weld between the wrong parts.

The whole purpose in Simulator Defense games is rotating the whole model (including held things) towards the target and on occasion rotating only the gun, I believe that using SetPrimaryPartCFrame would work the best here but you probably aren’t utilizing it properly.

okay don’t read what i am writing here i needed 30 characters

When i’m using sppCFrame, all the blocks are rotating incredibly fast around the primary part as the gun in the video in the reply above

  1. What does the whole model contain?
  2. What is the primary part?

primary part = body

Weld the gun to the body, and when you are rotating the model, the gun will be at its assigned position.

Hello there!

You should look into setting the primarypart,

If this is achieved and you have a part rotated, this also needs to be defined in the cframe as an add on to keep the constant rotation it is current at.

Okay i’ll look for it and try to figure out this problem

When I weld the gun to the body the gun is rotating incredibly fast as in the video in the reply above