If you ever have watched a show called sword art online, you would know what I am look for, but for those who have not (most people); I want it so that, when I swing my sword (a separate physics entity than the player), it will leave behind a thin red trail, that will dissipate after about a second. I will link a picture of the show’s effect below. I know I will have to do this through scripting, but I have no clue how to check for a physical contact, and have it ONLY display the effect along the surface of the object.
Note: I only need those red lines that for an X on the creatures back. not the explosion, or light beams
I am not asking for a script, simply where to begin.
Yes, preferably they would match where the swords struck. But yes, that is the idea. I want it so that when the player attacks, it leaves the red lines on the object attacked.
Though, preferably this would be a particle, so that i could have it fade after a short period of time.
Just to clarify (since my profile looks like a total noob) I am not a noob. I have used unity for well over a year, and other 3d software for longer. I am a intermediate java programmer with over three years of experience. I simply just haven’t had the need for a unity account, so that is why my account looks like a noobs.
I think a projector will probably be your best bet - create and orient it where your sword slashed the guy, pointing at your mesh. It’ll only really work on striaight lines, though.
Anything else is going to involve some sort of boolean mesh operations, which gets really complicated really fast.
Since I kind of need it to be very dynamic, How do I interact with a mesh like that? I am guessing that I would have to detect where on my sword the collision occurred, and the add a particle there, correct? or would I have to dynamically overlay a secondary image to the texture on the mesh?
Hmm… you may be able to raycast upwards from the hilt of the sword; anywhere the ray collides with the target mesh, add to a linerenderer’s points or spawn a particle there. That could work. The mesh in question will need to have a MeshCollider though (or, at the least, very accurate compound primitive colliders) to be able to receive the raycast.