#grenade
1 messages · Page 1 of 1 (latest)
Additionally, you may want to add some bouncing off the ground to make it more realistic.
How would you do it
You'd have to get a vector normal (perpendicular) to the surface of which the grenade bounces off.
Dot product is implemented in Skript and it will be useful for getting a "reflected" vector across the vector normal to block's surface.
this is sick asf
I think it's a bit more complicated since it's a curve and not a straight line
Don't interpret the drawing literally. It can be at scale of a few millimeters (assuming that a block's side length is equal to 1 meter).
Not to mention I have never seen a curved vector.
It's tangential to the trajectory of grenade at the point of bouncing off.
Scaled up version of the drawing with a grenade's trajectory added to make it more understandable.
Notice you have to repeat the computation of a reflected vector n times where n is the number of grenade bounces.
okay, now I'm motivated to make a bouncing ball or smth, thx
Also, it's important to add some kind of threshold at which grenade stops bouncing off.
You don't want it to bounce dozens of times within a few seconds at a scale of a few millimeters.
You can imagine how would it sound if there was a sound of a grenade bounce implemented. Basically, trrrrrrrrr...
yeah, you need to simulate it losing some energy by hitting the ground
Yes. Threshold is essential too because we don't care what happens at a scale of one millimeter (if not less).
It wouldn't be noticeable anyway.
Oh, and changing bouncing sound's pitch based on grenade's velocity would be great too.
But that's a detail. First focus on making it collide like a real thing.
yeah
If you do let me know
That would be sick