Ok I tried everything but I didn't manage to make a decal which stays always in front of the player so that I can make a small red dot from the laser of the weapon and round decal from the flashlight. Give me a small code snippet which examinate that pls.
Re: Decal staying always in front of the player
[Re: mEnTaL]
#302595 12/20/0918:2612/20/0918:26
as i understand you want to make a laser red dot which stays always on the surface(a wall for example) that is in the front of player like a crosshair but in 3d space.
is your camera fps or tps or anything else? are you use template script or your own one? which version you use (A6,A7,c-script,lite-c)?
anyway, the algorithm is one used in bullet hole code. instead of a hole-like bitmap you use a red dot one and instead of creating an entity(hole) for every bullet you create one entity in game start and set its position/rotation continuously (using bullet hole algorithm).
that is what you got to do.
also there is a high-end implementation called "projection" that needs use of complex shaders and i have no advise about that
every body got some dues in life to pay
Re: Decal staying always in front of the player
[Re: DR_Black]
#302615 12/20/0920:3112/20/0920:31
the camera is FPS, I don't use templates, and I use Lite-c. I know the bullet hole code, but I can't make it create the decal once and then just move it to be always in the middle of the screen - projected on the 3d space. So i need help with that : )
Re: Decal staying always in front of the player
[Re: mEnTaL]
#302623 12/20/0921:1512/20/0921:15
Hi. I bump that my old topic because I need a decal staying always in front of the player ( laser of weapon or flashlight trail), but I must make it by DECAL (ent_decal). The way with sprite adjusting its angles to the normal of the hit surface is not very realistic : ( So if you have experience in that things can you post the code snippet here pls