[SOLVED] Animated bridge.. need help with an issue
Posted: Sun Jan 31, 2016 2:40 am
The code below works just fine except one little problem. If you die and reload ( In game, not editor) the bridge is no longer extended. The bridge was built extended and I load an animation on initialize to retract it ( I only did this because the bridge kept disappearing on me
). I'm sure the problem lies in the "playOnInit", but I don't know what else to do there.


Code: Select all
defineObject{
name = "sg_stone_bridge_extend",
baseObject = "base_wall_decoration",
components = {
{
class = "Model",
model = "mod_assets/models/env/sg_stone_bridge_extend.fbx",
staticShadow = true,
},
{
class = "Animation",
animations = {
extend = "mod_assets/animations/sg_stone_bridge_extend_activate.fbx",
ready = "mod_assets/animations/sg_stone_bridge_extend_ready.fbx",
},
playOnInit = "ready",
loop = false,
},
{
class = "Controller",
onOpen = function(self)
self.go.animation:play("extend")
playSound("floor_sliding_end")
self.go.controller:disable()
end,
},
},
minimalSaveState = true,
editorIcon = 92,
tags = { "shadowgate", "dungeon extras" },
}