Hello, I’ve learned a tremendous amount about the Overwatch workshop since it first came out, I always wanted to get into Programming video games but it always seemed too complicated and got discouraged. I know more then what most people know about the workshop, but there’s a few more tools i don’t understand that i really want to figure out.
Okay! so ray casting, What does it do? And how does it work? I want to create an effect where the player is facing, I want to be able to create my own projectiles that you can shoot out and it’ll deal damage, Or even place effects mid air or in front of you. I have so many ideas for game modes using these concepts but i can’t because i don’t know how to use ray casting.
A detailed explanation how ray casting works, and its basics will be highly appreciated. I’m very confident if i can understand what ray casting is, it will nearly double the potential and variety of game modes i can make with the Overwatch workshop !
Ray casts work by getting two positions and stoping the end position at a wall that obscures the starting position. For example:
Start Position: Eye Position (Event Player Or Other)
The spot to check obstacles/players.
End Position: Add [Eye Position (Current Player)] Too [Multiply Facing Direction] By [Number, Preferably 1000]. The Addition Gives An Initial position, and the Multiplication Extends Out (Like you Or The Facing direction).
hmmm, I see. is there any difference between eye position and position of event player? I think eye position is just the coordinates of the players eyes right? And the equation seems kinda random to me. So adding the “eye position” to The “facing direction” of the player times what seems like a random numbers will give me what? Would you be able to explain the equation to me?
Adding the eye position gives an inital position to use. All if the player is facing up, the initial position will be were it will extend out from. Their facing direction is the direction it will extend, and the number is how far.
Hey, sorry for the late response i tried out your equation and it seemed to have worked. I made a very very very simple “Laser” code for testing. I made it so if you look at an enemy they start taking damage.
Still confused about what some of the equation is, But its fine i’ll learn as i go on.
Also one more question, Whats the difference between “Ray cast hit player”, “Ray cast hit position” and “Ray cast hit normal” i thiiiink i have an idea of what they are. “ray cast hit player” is if the ray cast hit the player, “ray cast hit position” is if the ray cast hit a surface, But i could be wrong. And i dont have a clue what “ray cast hit normal” could be.
The difference is what it detects. Player (Player), Vector (Normal), or Both (Position). You can also use the view details to see what actions/conditions do.
Also, if you want to you can use Players In View Angle/In View Angle, and damaging Specific Enemies you can use the filtered array (If you decide you want to use filtered you can ask me or someone if your confused, I have asked myself).