One Actor Checking Attribute Of Other Actor?

Hi, I'm working on a math game for kids where they drag number blocks over pictures that have sets of items on them. So, a number "5" block would be a correct fit over a picture of five carrots for example.

I have it worked out as long as there are not two of the same number on the stage but if there are two 5's for example only one of the "5" blocks is recognized as the right answer and the other "5" block is recognized as wrong.

My question is, is there a way for one actor to check a value of another actor? So I could have the number blocks and the image blocks have an "My Value" attribute that they check against each other? The values are all stored in tables so I don't think it's possible to use labels since the objects on the stage get their values at run time.

Thanks for any direction you can offer.

Rich

Comments

  • mc99093mc99093 Member, PRO Posts: 133
    Yes you can. Use the scene attributes. Both actors have to be in the scene. Choose Scene - layers - choose layer - actor - select attribute
  • -Timo--Timo- Member Posts: 2,313
    edited October 2013
    Yes you can. Use the scene attributes. Both actors have to be in the scene. Choose Scene - layers - choose layer - actor - select attribute
    you can only choose the scene when you are not in prototype. so just this actor

  • richcoyrichcoy Member Posts: 211
    edited October 2013
    Thanks I'll give that a try.

    I was also thinking that maybe spawning the actors into the scene would allow me to use actors that have labels. There is only 12 actors total on the stage at a time, 6 image and 6 number cubes.

    Rich
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    you can directly access the self attributes of any actor in the scene for an unlocked instance. However this does not apply to spawned actors since they are not in the scene before it loads.
  • richcoyrichcoy Member Posts: 211
    Right, but could I spawn an actor with a tag of say "5" and then test for collision with another actor with the tag "5"?

    Seems like that route would work if there were multiple "5" in the scene at a time.

    I'm probably making this harder than it has to be. lol.

Sign In or Register to comment.