Skip to main content

Search

How can I make a continuous laser beam that terminates at the point where it hits something?

  • mmdev7

    So I think the way to do this is to make the laser beam out of a stroke and then set the length on the laser pointer gadget the same length as the stroke (use the grid to make the stroke a nice neat length.

    Then wire the current laser pointer length into the end point input on the stroke.

    The laser pointer also gives you a hit position which can be wired into the spawn position on an emitter so you can emit sparks when the laser hits a surface.

    Hope this helps :) Peter

  • blockbuster95

    how do you break the hit result from the laser ? say it was set to 100m, the object hit was 50m away from the spawn point, how would you set the stroke length to 50m to hit the object in range ? plugging the falloff and range into the inputs does nothing as it outputs either a 0 or 1 value (Boolean)

  • mmdev7

    Not falloff, but on the last page of the laser gadget there is a hit distance output. Plug that into the end position of the stroke :)

  • blockbuster95

    cant post pics but wired it up and it still sets it to full length, when an object isnt in the laser view the stroke is a 0m but as soon as something is in range of the laser it goes all the way to max length, tried taking the total length of the laser - the hit distance output then inverting to get the total distance to target and it just outputs 1, either its my bad maths or im missing something silly xD

  • Tristan1701

    I'm getting the same thing. If I plug the output of Hit Distance into a Value Slider it just shows 1.0 if a detectable object is any where in range and 0 if it isn't.

  • phort

    Add a Calculator gadget to check if Hit Distance Equals Zero, multiply the one-or-zero value from the Equals by the laser's Max Distance, and add that number to the laser pointer's Hit Distance.

  • StankyDino

    Mine is working. If you have a Laser scope with falloff distance that matches the length of the stroke, and run Hit Detected through a Signal Manipulator that inverts it, then plug that into the End of Stroke input.

Please sign in to leave a comment.