I’m trying to create a basic flamethrower. One which has a flame particle follow your mouse, and a beam going between your mouse and the gun’s barrel.
I’m attempting to do this by setting the end attachment’s position to be the mouse’s position, however the gif below is the result, which is not what I want. The beam just shoots off into space. I’ve checked the point’s position, and it’s where it should be (using raycasting to the mouse).
Both attachments for the beam are inside the “Tip” part of the tool. I’m moving the “End” attachment around to the mouse and having the “Start” stay at the Tip.
But if you set Mouse.hit.p as the Position of the Attachment won’t that be offset by the gun barrel not being at 0,0,0? Or did you already account for this?
You can make a part at 0,0,0 and put the second attachment in there, or you can try putting it into terrain (although this is kind of hacky and might not be supported 5ever).
The other options is to use CFrame inverses to find the offset, but it’s much easier to just put the attachment into a part that’s at 0,0,0 lol
To stop supporting this, Terrain would have to stop inheriting from BasePart which would probably cause more problems than it’s worth. I’d say Terrain is a great location for all your Attachments-in-World-Space needs. I also use it for things like HandleAdornments.
The best part in my mind is that you can’t accidentally delete Terrain. It’s always there.