Hello developers, currently I’m working on a game where the player falls extremely fast using velocity. However, Iv ran into an issue involving hit detection.
My current method of detecting if a player hits a part when falling is by using renderstepped and casting a ray from the player HRP a certain amount of studs and seeing if it hits something, however, if the player is falling too fast sometimes it doesn’t detect when a player collides with an object.
yeah so basically, your origin needs to be the players last position (keep track of this in a variable or something) and the -10 studs down needs to be the magnitude between the players last position and current position
I am not sure if this is what I’m looking for because currently, in every frame I’m getting the players new HRP position and casting a ray to 10 studs below the player to see if they hit something
Maybe this image will help understand. Method 1 is how you’re doing it, and Method 2 is how I’m explaining. The issue is that if you’re going too fast, the player position might just go through the ground from frame 1 to frame 2.
but in method 2, casting on frame 2 where the origin is the players last position and the distance is the magnitude between the last position and the current position it’s guaranteed to check if the player went though the ground for any speed