Relative position of a part to another with rotation

Hello! I want to create a spaceship with some particles. A seperate part on the spaceship is a particle emitter and I would like to keep it offset to the ship as shown, even when the ship changes position and rotation.
Spaceship with particle emitter

I looked up some other devforum posts and I found one for finding the offset for two parts then using that for another two parts; which doesn’t fit my situation.

Thank you!

3 Likes

Can you weld the particle emitter to the ship? Welding it will make it stay at a certain position constantly and change its angle and position as the ship moves.

I’m updating the ship position by script; not roblox physics. I tried welds but they didn’t work :pensive:

1 Like

Can we see a video of what happens when you try to do it?

If it is just being moved by scripts, you could do 3 things:

The first option would be just to have an AlignPosition and AlignOrientation that affect the part with the particle emitter. This could be an issue though if your ship moves fast.

The second option (the one you’re looking for) would be using LookVector, UpVector, or RightVector to offset the emitter. An example would be:

local base = --The base / primary part of the ship
local emitter = --The part you're trying to change.

emitter.CFrame = base.CFrame * CFrame.new(Base.CFrame.LookVector * -5) --5 would be half of the base size.

The third option would be to put the whole ship into a model, set the base as the PrimaryPart, and use model:SetPrimaryPartCFrame. By using this function, it moves everything in the ship model all at once, including the emitter.

1 Like

when using a weld the part that youre welding cannot be anchored or else it wont move with it . was the particle part anchored?

2 Likes

Try this. Put everything into a model. The part that is having its position updated, Anchor it. The other part will be unanchored but welded to the part that is having its position updated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.