RayCast Platform’s and Lasers Game

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

An educational ROBLOX Project with a emphasis on RayCasting.

ROBLOX has a documentation page on RayCasting here they show a little platform game it show cases a fire particle part with a laser going directly down they will slowly move across the platforms before determining if a platform is below it then temporarily destroys the platform with a beam or trail of sorts and a fire effect and tweens the colour transparency before disabling the can collide feature

  1. What is the issue?
    I cannot figure out how to get the laser to come from the RayCast I cannot wrap my head around it!

  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have come to the developer hub as I cannot understand RayCast currently and feel this would help inspiring developers grasp the concept.

This page showcases the mini game I am attempting to re create:

First you’ll need to make a part with 2 attachments and move this part to go above platforms of your choice (randomizable) with a tween when the goal is reached you only have to wait the time to destroy the platform (I mean after 2 second you disable the part can collide and all and remove it from you platforms table) and go to another !
I think that making the lazer effect is pretty simple, you’ll have to make a beam and set attachment0’s position to your raycast origin (part center) and attachment2’s position to result position and enable it when the part tween goal is reached and disabled it when the part is tweening !
I hope that was helpful and have a nice day !

1 Like

Quick question, should I use a physical part and have that conditionally check when it’s touched I feel like that would be easier than RayCasting however I definitely want to use RayCasting I’m unsure or the actual use-cases for RayCasting if it already requires a extra part and a attachment to function?

The source code on the site I used I couldn’t even get to print the result of the Ray I just kept getting nil

Thank you for your answering and taking the time to help me :slight_smile:

1 Like

Sorry, but I don’t understand really well the question, are you talking about the part where you want to destroy platform or the way of moving the beam ?

I’m talking about using RayCast to destroy a part below it based on its name.

I’m also talking about moving the particles I’m referring to both, when I tried I couldn’t get the RayCast to even print the result of what was hit.