Help Explaining on Flowlab Part 1 - Raycasting

Before everyone shouts at me I have been using Flowlab for about year now and has begun to become very good with the coding. Unfortunate, I still remain at a Basic level of this because I still have no Idea how to use certain features. That is why I started this new Flowlab series called “Help Explaining on Flowlab!”. But although this is to get a better understanding of Flowlab, this is not just for me - but for everyone! Like a “Flowlab for Dummies Guide.” I just want an easy, down to earth explanation of what some features do. This one focuses on Raycast, but their will be more entries. No offence @grazer but the explanation given was complex and hard to understand and I would just like someone to go through with me in a steady pace who can tell me .

  1. What it Does

  2. How To use it

  3. Different Examples of How it is used

  4. A Basic summery

I hope everyone who reads this and the [Future] comments understands what raycast is and all above when done. Now I know many are capable of doing this but I do want to call upon some Flowlab Veterans like, @“JR 01” @PixelPizza and @todorrobot along with the obvious @grazer but please, anyone, be free to reply.

Raycast isn’t to complex. Basically you can set a invisible line what height and angle you want. Then you set the object, so when the invisible line hits that object it triggers it.

So how would you use it @“Johnny boy”

You can use raycast to determine whether an object is in a certain direction to the object with the raycast. It will send an output depending on whether the ray hits the desired object or it it misses it. This can be useful to make enemies not fall off of ledges while they are walking around, or for the player to review their surroundings in a certain direction.
As @“Johnny Boy” said, you can determine the height, angle, and object you want to detect. At its core, it should be a simple contraption. In one of my games (link will be provided on request), I use it so that the enemy can jump over a ball ONLY when it is to their right.
So just a recap on raycast:

  1. Raycasts detect specific objects within a certain height and angle.
  2. “Cast” input casts the ray. “Hit” output activates when the desired object is found, while “Miss” output activates when it is not found.
  3. Raycasts can be used to search for objects in a players surroundings in a specific direction or to prevent an enemy from falling off a ledge.

Oh… THANK YOU SO MUCH @Superstargames and @“Johnny boy” basically, Raycasting is an invisible line in which asks you what you want to do when the invisible line hits a certain selected object (Please correct if I am wrong)! I do have a few follow up questions but I am so glad that was explained.

  • Does it work for Top Down games (Can the line go up and down)?

  • When on raycast can we view the line?

  • Can it be turned on and off when wanted and not?

  • You can rotate the raycast in any direction, but they do not rotate with the object.
    *For raycasts to turn with the object, its rotation needs to be updated.

  • The Line is only view-able when you edit the behavior

  • Its not On or Off, its whenever you cast that it outputs.

Here’s a Raycast example I just made @“The Kodex”:

Thanks @“JR 01” and everyone else who posted! Please do take a look at part 2 and see if you can help on that as well! @“Johnny boy” @Superstargames