How to make a rock impact system work like this?

Ok so I’m trying to do something like this >
Red is the initial raycast,
Blue is the end position aswell as the normal,
and Yellow are the points where the rocks would appear

I’m trying to make this like so rock impacts happen on pretty much any surface, which I can’t really find a resource for

2 Likes

Nice, a low performance shotgun

  1. find the normal orientation of the surface or offset by raycastresult.destination
  2. use trigeometry (unit circle)
  3. offset the appoporite amount
2 Likes

What is unit circle, how do I do

2 Likes

Unit Circle
have a list of angles around a circle which the offset balls will be

input an angle for math.sine, that will be height offset
input an angle for math.cos, that will be sideways offset.

instance.new attachment, parent it to the launcher, that way, the offset will be relative to the launcher. offset x and y using math stated above, then attachment.position.z should be raycastresult.distance.
Finally, set your rocks cframe to attachment.worldcframe

Quick note, the offset should be vector3.new lol

2 Likes