Using a slider to control spacing between actors
SproutLabs
Member Posts: 2
I'm working on a new game and, without getting too into the context, I'm trying to use a slider on the Y-axis to continually increase and decrease the distance between two actors.
The two actors should be moving equal distances from each other to make up this total distance.
The top of the slider will create the biggest gap between the two actors, and the bottom of the slider will bring them almost to the point of touching.
I think that should be clear enough. Let me know if I can make anything less vague!
I would really appreciate any insight you guys might be able to throw my way.
Thanks a lot!
Answers
It's fairly straightforward, let me make you a little demo, back in a second . . .
Here you go . . .
Link: https://www.mediafire.com/?1ks4kqtpj64jxjv
Thanks for responding so quickly!
Tell me if I'm wrong, but I think your demo is essentially tying each actor to the slider independently.
I was hoping for a way to adjust the distance between them directly, as their individual positions will be changing regularly throughout the game, which makes direct slider control kinda tricky.
I figure this might not be possible since the space between actors isn't an actor in and of itself.
Another potential way my problem could be solved is if I found a way to use a slider of a certain height to move an actor within a much smaller range.
For instance, if my slider is 400 tall, and I want to move an actor within a distance of 100 tall, how could I make it so that when the slider is at 400, the actor is at 100, and when the slider is at 0, the actor is at 0?
Basically, I would need the actor to move at a speed 1/4 of the speed of the slider if I want the whole thing to move smoothly.
Any thoughts?
Yes, each actor take its X movement from the Y position of the slider.
I don't know what this means, I only speak English, GameSalad and a litl-bt-o-intrnt-spek. Not sure what 'directly' means in this context.
Not sure what that means either, sounds quite metaphysical. You can get pretty much anything to move anywhere in relation to anything else with a little bit of maths, the problem is often understanding the question.
Not sure why the actor's height would have any bearing on the situation, but maybe I simply don't understand what is going on.
Again, I'm not 100% I know what you mean, . . . . . but if you want to map 0-400 to 0-100 then the calculation is simply divide by 4.
Speed !? Ok, I really have no clue, lol !! Initially I thought you wanted a vertical slider that controls the distance between two actors - but I think I might have misunderstood the question, I'm not sure how 'speed' and 'height' relates to situation ?