They have a velocity check when they collide with things and and that's it, but it's possible for them to be pushed to reach that velocity threshold.
Wouldn't it make sense to check if they're in a running state (I don't know if their walking state would be intended to allow destruction either).
Could check on the physics collision callback with something like this:
inst.sg:HasStateTag("running")
And then check for velocity.
You could potentially even check for the state tag before anything else in the physics collision callback, kinda like this:
local function oncollide(inst, other) if not (inst.sg ~= nil and inst.sg:HasStateTag("running")) then return end if other and not other.isplayer and other:IsValid() and other.components.workable and other.components.workable:CanBeWorked() and other.components.workable:GetWorkAction() ~= ACTIONS.NET and inst:IsValid() then local t = GetTime() if (inst.recentlycharged[other] or -math.huge) + 3 <= t then local vx, _, vz = inst.Physics:GetVelocity() if vx * vx + vz * vz >= 42 then if inst._shaketask == nil then inst._shaketask = inst:DoTaskInTime(0, DoCollideShake) end inst:DoTaskInTime(2 * FRAMES, onothercollide, other) inst.recentlycharged[other] = t + 2 * FRAMES end end end end
Could even make the collision callback only be set when entering the running states, and set to nil otherwise, but I don't know if it'd be wise or even safe.
Just some suggestions though.
- Have multiple Rooks or other entities with enough mass push Rooks around. You can try spawning a bunch of them in an area enclosed by walls.
- Notice how they can collide and destroy obstacles when pushed this way, even if idling.
-
3
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now