27 lines
644 B
Lua
27 lines
644 B
Lua
local module = {}
|
|
|
|
local spring_modifier = 1
|
|
local function setup(this,spring,context)
|
|
this.spring.Damping = _G.GetValue(spring,"Dampness",this.spring.Damping)
|
|
this.spring.Stiffness = _G.GetValue(spring,"Stiffness",this.spring.Stiffness) * spring_modifier * spring:GetScale()^3
|
|
this.spring.Visible = this.spring.Stiffness > 0
|
|
end
|
|
|
|
function module.new(this,spring,context)
|
|
this.spring = _G.GetInstance(spring,"SpringConstraint")
|
|
setup(this,spring,context)
|
|
end
|
|
|
|
function module.update(this,spring,context)
|
|
print("setup")
|
|
setup(this,spring,context)
|
|
end
|
|
|
|
module.update = module.new
|
|
|
|
module.manifest = {
|
|
"Coilover",
|
|
"Wheel"
|
|
}
|
|
|
|
return module |