laser pointer 2 problem!

the laser pointer should have a round like this :

control :
Z or W or Up to walk
S or Down to back
0 (zéro) and right mouse button to change camera mode

please Help!.

  1. I would recommend learning Python enough to alter others’ scripts to suit your purposes, rather than requiring ‘ready-made’ resources (i.e. learn how to do x yourself, or ask how to do x, rather than asking for someone else to do x for you). Learning Python to this extent shouldn’t take too much time at all.

As for your problem, you need to get the hit position of the ray and then place the ‘round’ there. I made a function for this purpose and assigned to the laser beam. It gets the round (which is the child of the beam), and places it where the ray sensor’s hitPosition desginates, which is where the beam ends. It also aligns the laser point’s orientation to the surface using the ray sensor’s hitNormal variable (alignAxisToVect(hitNormal, 2)). The 2 in that function call aligns the laser point’s Z-axis to face the same direction as the ray sensor’s hitNormal variable.

  1. Have the laser check for a property instead - then, only objects that have that property will make the laser stop (then you would give the objects that you want the laser to ‘connect’ with that property).

Anyway, here’s the example.

Laser_gun.blend (884 KB)

thank you for the help. the laser point in your .blend track the laser slowly and it stuck in the last target.
I already have this method, it does not stuck in the last target, but as yours, the point track the laser slowly :

any idea to fix it!

ok, here is what I got. The script is from Goran’s tutorial, I just edited it a little bit because I don’t know how to script XD (896 KB)

many thanks @ehabcharek! but the laser track the laser_flare slowly.

well… you want this for a FPS game, right? if so, then you should use the camera’s Ray sensor, because it puts the crosshairs right in the middle. you can use this method, which is slow (unfortunately :/) or you can make it an overlay scene which will keep it the way it is no matter what the lighting condition is