I’m really excited about this, as it’s my first time making something as complex as this (might not actually be that complex, but it’s still something I haven’t been able to do for a while. )
Anyways, it’s a raycasted decal system that creates decals that map to the surface correctly.
It also spawns another raycast if it detects a humanoid, which also goes through said humanoid, and changes the texture of the decal on the otherside of the humanoid - if there’s not another one directly behind it.
I might open source this since there’s currently nothing else on Roblox’s toolbox that has the same level of quality as this. All it requires is a “hook” from a raycast function.
Game That It's Being Used In (and was originally purposed for)
Please note that Deathmatch & Infection currently do not utilize this system, and as such, may break. Only CTF & Team Deathmatch have this system currently!
Cross Product, Re-casting rays, and a little bit of math.
I might move this over to #learning-resources:community-tutorials-resources if I decide to open source it. Probably will be after I transition it to a surface-GUI instead of a part-based decal system so the decals are clipped.
All I’m doing is translating the position in which the ray collides and what that translates to on a scaled UDim2 SurfaceUI element. Super quick to solve, and I’m pretty sure I’m doing a messy job of it at that.
Because of how I’m solving it though, I can also utilise it in .Touched things as well! Its not accurate when used in a larger object, but in smaller ones with non-accuracy needed its incredibly useful.
I’m not entirely sure how I could utilise Dot product at the moment, as I’d then have to solve to create additional parts and sizes.
Well, at the end of the day, it might be simple. But I wasn’t able to figure it out, and I needed it quickly. 15,000R$ is not that much to me if it means figuring out an important aspect of a game.
I didn’t really intend it as a flex, I suppose I shouldn’t have used a specific amount. I’ll reword it.
I just thought it was funny that I had to contract someone out not long ago and then just a couple of months later somebody posts exactly what I needed and contemplated giving it out for free.
I just remembered why it was hard for me. I wanted it so that a decal couldn’t extend over the edge of the face it’s on. That’s what I couldn’t figure out.