I’m currently attempting to create a placeable C4 tool, however, I’ve hit a snag. I’ve completed the basic placement system with raycasts, but now I want the top of the C4 model to be aligned with the surface it’s placed on (i.e. the top of it is always facing away from the center of the part it’s being placed on).
I’ve already searched through the devforum, but can’t find anything useful. Any help with my issue would be much appreciated, thanks in advance.
Do you already have the normal of the desired surface? If so, you could try placing your C4 model this way:
C4.PrimaryPart.CFrame = CFrame.new(position, position + normal)
This will place the C4 at “position”, and have it face in the direction of the normal. Depending on the model itself, it’s possible that it won’t be oriented properly, but in that case you can apply a rotation with CFrame.Angles()