Part.SoonTouched

There’s many usage cases for this but I’ll mention three off the top off my head:

  • Player is driving his car and hits an enemy

  • Currently I’d have to set the enemy to a ragdoll state after the .Touched hit triggers, which really messes with the vehicle velocity because it thinks it hit an player and thus slows down very fast

  • Use magnitude/raycasting/Region3/Hitbox checks to predict what I’ll hit. This is just wrong. Not only is it innacurate, it’s also inefficient and very hacky.

  • With Part.SoonTouched (wip name) it’ll say “Hey next frame this part is gonna be hit” and I’ll have time to replace the character with a ragdoll and everything will work super smoothly

  • Player is driving a vehicle (tank?)

  • Tank runs into fence

  • Tank bounces back

  • .Touched is triggered and the fence is destroyed

  • Tank now rebuilds velocity and goes through it

  • This is just ugly

  • Debris falls from fragmentation of a wall/building/destroyed vehicle part flying

  • Debris hits player

  • Bounces back

  • .Touched triggers

  • Debris is still flying the other direction because it thinks it hit something it couldn’t move

  • With .SoonTouched I could ragdoll the player the frame before and let the physics demolish the ragdoll using the debris like it should :astonished:

Not sure if there are any performance issues with this. If there are - maybe make it so that the engine only checks for .SoonTouched if there’s code that asks for it.

Here’s an example of the current way things work (Video 1) + how they would work if roblox implemented this for us (video 2). Credit @1waffle1

19 Likes

Hmm, I could definitely see this being useful. I also can’t see it being done easily engine side. If this is practical, I would want to see it.

4 Likes

This is a client feature, so it should probably be moved to that category instead.

I believe this is already the case for .Touched

Here’s a demo place file. Click to shoot a ball at the wall. The wall is anchored, but the ball unanchors what it hits. The ball bounces off of the wall until the same spot is shot a second time, having been unanchored by the first ball that bounced off.
WallDemo1.rbxl (16.2 KB)

Compare that to this, which records the position and velocity of the ball, restoring those values to the last heartbeat every time the ball unanchors something.
WallDemo2.rbxl (16.3 KB)

SoonTouched would allow the first to behave even smoother than the second.

Demo 1

Demo 2

1 Like

Yes! This perfectly shows both why I want it and why it’d help a lot of roblox made it themselves.

I think you may have forgotten to reply to @Osyris though haha

I think perhaps suggesting a feature the day before a code freeze wasn’t a good idea…

1 Like