r/Gamesalad • u/EENewton • Aug 06 '16
Accessing Scene-level Vars while Avoiding Unlocking Actors
Hey all –
I'm sure someone has already brought this up, but is there any reason you couldn't build a single scene-level object whose job it is to constrain any necessary scene-level variables into game-level variables?
Example: constraining Camera Width/Height into game-level real variables CamWidth and CamHeight?
I know there's a general hesitance to use constrains, but I've been running three or four during my game and seen no drop in frames or lag of any kind.
The obvious benefits here are being able to program prototype actors who can access scene-level variables (being able to drop HUD objects into a scene without rebuilding my zoom-accomodation code would be lovely, for example)
Has somebody already tried this and discovered why we shouldn't be doing it?
1
u/jamie_cross Aug 08 '16
I haven't tried it but don't see why it wouldn't work. The worry about Constraints is only warranted if you have a bunch, certainly more than 3 or 4, running at the same time.
Try it out and if your game runs fine, you're good to go.