ENTITY:ResolveCustomFlyCollision
Description
Called during a non-VPhysics collision event for flying entities.
This is best used to bounce off projectiles from surfaces. For this to be triggered, your entity must be the one that's colliding, have some velocity ENTITY:SetMoveType must either be MOVETYPE_FLY or MOVETYPE_FLY_GRAVITY and ENTITY:SetMoveCollide must be MOVECOLLIDE_FLY_CUSTOM.
This works only on
anim type entities.Arguments
1 table with TraceResult structure traceResult
The TraceResult structure where the collision occured.
2 vector vel
The calculated velocity after calculations such as bounciness, elasticity, ground sliding etc...
Example
A rocket model which directly reflects off from surfaces without any velocity loss, similar to sent_ball.
Garry's Mod
Rust
Steamworks
Wiki Help