Developer’s Journal: Raycasting to Make Reflectable Lasers

djcatbloxHello everyone, this is Catblox–I’ve been a long-time member of ROBLOX (five years and still going) and a scripter for a little over half that time. Today, I’m going to talk about some more advanced ways to use ROBLOX’s raycasting API – namely simulating the interactions of lasers with mirrors. I’ll walk you through the steps of how to turn an idea like this into a finished product, explaining the basics of vector (and Vector3) math and features of ROBLOX Studio’s API along the way. To check out an example of what I’ll be explaining, check out this test level I made, which will show you the basics behind this premise.

Continue reading
     
 

Raycasting with Daxter33, Creator of Paintball!

Raycasting is a method of plotting the trajectory of in-game items, like bombs, lasers, explosions, and bullets. Though it isn’t entirely necessary to make a successful  game, certain users have found ways to leverage the system to create innovative gameplay mechanics. We thought we’d explore the concept by talking to Daxter33, creator of the ever-popular Paintball

Here’s how raycasting works: every weapon that features projectiles has a trajectory or, more simply, a path to travel. When you shoot a gun with instantaneous speed projectiles (as opposed to guns with slower projectiles that are physically simulated objects), you create a vector, which is determined by finding the gun in 3D space, the point it’s going to hit, and subtracting the two. Basically, you find a direction for your bullet to travel. A raycast can determine that path for you, as well as identify objects that appear in the path of the traveling bullet. You’re tracing a beam of light through 3D space.

Continue reading