Game Development Community

Behavior Instances bug - Issues with ActionMap binding

by Simon Love · in Torque 2D Professional · 07/19/2013 (6:24 am) · 0 replies

Originally discussed here: github.com/GarageGames/Torque2D/issues/98

Greetings fellow T2D-ites and T2D-ettes,

When creating a Behavior which defines ActionMap bindings, it would seem that only one Instance of the Behavior will react to the bindings.

If you clone an object, the behavior is cloned with it but the input will only affect the original object.
If you remove the behavior from the original object, the behavior will start working on the clone.

Example, taken from Mike Lilligreen's WorldWrapToy

moveMap.bindObj(getWord(%this.upKey, 0), getWord(%this.upKey, 1), moveUp, %this);

My guess is that behaviors could be scripted differently, i.e. instead of calling bindObj on the behaviorInstance, we could call it on the Instance's owner instead (which works fine). The downside to this method is that we lose the modularity of the Behavior.

What we have to find out

- Is there an easy way to bind input from the Behavior and have it work on multiple instances at once?

Let's make some tests and share our findings!

About the author

I am here to help. I've worked at every imaginable position in game development, having entered the field originally as an audio guy.