Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions lua/wire/gates/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1236,4 +1236,38 @@ GateActions["entity_eyepos"] = {
end
}

GateActions["entity_setanglevelocity"] = {
name = "Set Angle Velocity",
inputs = { "Ent", "Ang" },
inputtypes = { "ENTITY", "ANGLE" },
timed = true,
output = function(gate, ent, ang)
if not isAllowed(gate, ent) then return end
local phys = ent:GetPhysicsObject()
if not IsValid(phys) then return end
ang = clamp(Vector(ang.p, ang.y, ang.r))
phys:SetAngleVelocity(ang)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You turned the angle into a vector and broke the function

end,
label = function(_, ent, ang)
return string.format("(%s):setAngleVelocity(%s)", ent, ang)
end
}

GateActions["entity_setvelocity"] = {
name = "Set Velocity",
inputs = { "Ent", "Vec" },
inputtypes = { "ENTITY", "VECTOR" },
timed = true,
output = function(gate, ent, vec)
if not isAllowed(gate, ent) then return end
local phys = ent:GetPhysicsObject()
if not IsValid(phys) then return end
vec = clamp(vec)
phys:SetVelocity(vec)
end,
label = function(_, ent, vec)
return string.format("(%s):setVelocity(%s)", ent, vec)
end
}

GateActions()
Loading