Creating a paint gun that splats onto surfaces

Hey all, so I’m making a project where you can shoot paint on surfaces to change the way you interact with them but I’m a bit stuck on how to put a paint splat on a surface where a projectile lands. A good example of the mechanic I’m trying to implement would be Tag: The Power of Paint’s paint system or the Portal 2 Gel system. I want to be able to splat the paint across different surfaces depending on where the paintball lands, and also so that the paint splat image doesn’t go off the side of the parts.

I’d want to be able to fire my gun and create a strip like that, and also be able to remove it using Water which will erase all paint it hits.

I honestly have no idea how I could get the face the paint lands on, its CFrame, and then position a splat onto it with a part for touch detection and an image that is clipped by the part surface.

Thanks in advance!

With some simple raycasting, which I recommend you learn, you can shoot a ray, and wherever that ray lands, you create a part, set it to where the ray landed, modify its properties a little bit like its transparency and size ect. And add a decal or surface ui to it containing the image of the paint splat. The paint splat might be the part itself, making it circle so it looks like a splat.

1 Like

Would this work though if the paint blobs fall down? Wouldn’t my raycast detect the side of a wall but the paint falls and hits the top of the floor? If the straight ray comes out of my gun it will hit the side meaning the paint will be sideways.

You don’t want the paint to face sideways?

Well, depending on where the paint lands the paint will face a different direction. Say the paint gets shot up, but falls and hits the top of a part. The paint fill face upwards. However if I shoot at a wall the paint will face sideways.

Essentially I want to get the surface a part hits and then CFrame it so it lands on the surface.

I still have no idea how to solve this, can anyone help me?

You want to the paint to be splat in other surfaces as well?

@qEvann Yeah. Ideally I want to be able to have paint similar to the Ink in Splatoon, but I don’t know how to get the surface the paint touches and the CFrame it needs to be set to.