Referencing other actor's attributes

henshousehenshouse Member Posts: 2
edited November -1 in Working with GS (Mac)
I just joined, and immediately followed the Pong tutorial in the wiki. I got it all working fine, but wanted to make it 1 player, rather than 2. So I tried adding my own AI that basically just follows the Y position of the ball. I couldn't get this to work because when I wanted to check if the Y position was higher or lower than the paddle's Y position, I was only allowed to check game and self attributes, not other actor's attributes.
Thanks for your time

Comments

  • Ruslan21Ruslan21 Member Posts: 228
    you cant check other actors attributes ,\. Only self or game

    Hope thats helps
  • henshousehenshouse Member Posts: 2
    So, is there any way to do what I am trying to do?
  • jstrahanjstrahan Member Posts: 498
    Make a game attribute of real type and call it bally
    Inside ball actor constrain bally to self.position.y
    Inside paddle actor constrain self.position.y to bally
  • Ruslan21Ruslan21 Member Posts: 228
    yes . you can send project to me ill take a look.

    shakirovruslan2008@gmail.com
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    henshouse said:
    ...I was only allowed to check game and self attributes, not other actor's attributes.

    Hi henshouse, welcome to the Forum! You can change any other actor's attributes, providing this is done through an instance of an actor (one on screen) rather than its Prototype. (This is the one in the Inspector). Via a Prototype Rules, you can only change self and game attributes.

    Double click the instance of an actor – one of them on screen – then unlock the Rules section if it's not already. Then within its Rules, you can get to any other actor's attributes by the following method:

    Click the three dots to get the attribute browser, or the "e" to get the expression editor. In either one, click Current Scene > layers > Background > then you'll find a list of all the actors in the scene to choose, then choose its particular attribute to change/modify.

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RHRH Member Posts: 1,079
    @ gyroscope

    Wow. How did i not know this. I thought I had GS sussed, geeez, thanks!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Glad it helped out, RH! :-)

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ZillaZilla Member Posts: 157
    Screams:AWESOME!!!
Sign In or Register to comment.