What do you want to achieve? I’m trying to make a very bouncy ball with physics but every topic I look at uses ray casts
What is the issue? I dont know how to do this
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
everything that i saw on the developer hub about this used raycasts
also i am new so if you can try to simplify it
may i ask what is the if statement for also what is the part variable supposed to be (asking this because the original script i used was inside the ball)
So basically, when a ball hits a wall it bounces off in the opposite direction. You would probably just want to add 90 degrees to the ball orientation:
45 degrees → 135 degrees
which actually works for this situation but if you have something like:
10 degrees → 100 degrees
it would look like the ball is hitting an invisible wall facing the incorrect direction. So you have to find the difference between the angle of the ball and the angle of the wall:
Now that I think about it, it’s probably easier to learn about ray-casts than to use this as it’s very difficult to find which side was hit without using 6 hitboxes (which just complicates it way too much).
How do I put raycasts in a weapon that uses roblox physics? Basically I’m trying to make SCP 018 but it just flings out of the map or gets stuck in the floor at one point even if I limit the speed
Raycasts are used by doing workspace:Raycast() so they technically aren’t anywhere they just appear whenever you use that function. For a weapon you could just raycast at the position of the weapon in the direction it’s facing.