Drag the actor on different position make different pitches of sound

yichenchiyichenchi Member Posts: 0
edited April 2012 in Working with GS (Mac)
Hi,
I'm new in GS,
What I would like to do is....
My actor has the drag and drop attribute....and while you touch it, it will play a sound.
And my question is how can I setup the sound to change pitches depending on the position of the actor?
Logically I know what i have to do is something like...
if self.Y.position is a~b
then play sound and set the pitch in Expression Editor...

But I have no idea how to get the position of the actor....

Hope you understand my question...thanks!

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You can access another actor's attributes in one of two ways:
    (1) Constrain game attributes to the actor's self attributes: Constrain Attribute game.MovingActorY to self.position.Y. Then in the pitch expression editor, use game.MovingActorY for the value.
    (2) Unlock your sound actor instance in the scene where you placed it and then in the pitch expression editor, click on Current Scene-->layers-->(layer name, e.g. Background)-->(actor name)-->Position-->Y.

    The second way offers better performance.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.