drarem Posted April 20, 2016 Share Posted April 20, 2016 I'm at the point where I think I need to use a flowgraph. I have an invisible trigger box parented to an animated treasure chest. When I run into the trigger I want the animation of the chest to play (by opening).. I added the CollisionTrigger.lua to the box, added to flowgraph and i see three functions in the flowgraph. So far it looks good. For the animated box, i have a script to open/close the box, but when i move it to the flowgraph, it has no functions. How would I set it up to receive the input, to trigger the animation? thanks. Quote Link to comment Share on other sites More sharing options...
Rick Posted April 21, 2016 Share Posted April 21, 2016 Look at the CollisionTrigger.lua. You'll see that inputs have a --in at the end of the function. That tells the flowgraph to include that. You can also see how to get outputs. It's something like CallOutputs("Outputname") or something like that. Just look in the CollisionTrigger to see these examples and then apply those ideas to your script. Quote Link to comment Share on other sites More sharing options...
drarem Posted April 21, 2016 Author Share Posted April 21, 2016 Does it work for prefabs? I have this code and it works for the model on the map, but I saved as a prefab and spawn it it also, it doesn't display any message or open. function Script:Collide()--in if self.animationmanager==nil then self:Start() end System:Print(">>> And this collision is called in turn..") if self.opened == false then self.animationmanager:SetAnimationSequence("Open",0.04,150,self,self.EndOpen) self.opened = true end end Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.