So I’m trying to make a spray paint bottle right now, and since my game is shift-locked I’m going to raycast in front of the player’s camera and use the intersection position of a potential hit to see what the player is trying to spray. An invisible part with a decal on its front surface would then be put at the intersection position. One thing I need to know though is how to align the invisible part with the spray decal on it to the surface it hits. For example, if a player was looking forward and the raycast hit a part standing upright (like a wall), and it was its left surface, then the part with the decal on it would still face toward you, like this:
Also as well as complicated rotated parts like this:
I think this has something to do with surface normals, but I have no idea how to use them or how to accomplish this. Can someone help?