Is there a way to check if applyimpulse was used on a part

I was just wondering if there was a way to check if applyimpulse was applied to a part, as it doesnt fire for .changed at all


This event does not fire for physics-related changes, like when the CFrame, Velocity, RotVelocity, Position, Orientation and CFrame properties of a BasePart change due to gravity. To detect changes in these properties, consider using a physics-based event like RunService.Stepped or BasePart.Touched. A while-true-do loop can also work.
- Instance | Documentation - Roblox Creator Hub

So you can’t use .Changed, and even if you could it wouldn’t work as the physics properties might change for many reasons other than ApplyImpulse being called.

Consider writing your own function to wrap ApplyImpulse to do whatever you want in addition to the normal behavior, e.g.:

local event = script.OnPartImpulseApplied
local function myApplyImpulse(part: BasePart, impulse: Vector3)
    event:Fire(part, impulse) --Make other scripts listen to this event being fired.
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.