Attaching one actor to another

NinjaworxNinjaworx Member Posts: 20
edited November -1 in Working with GS (Mac)
I've searched the forums and also checked out some demos but I'm missing something here. I want a glow to follow my player actor. The player is currently controlled by tilting the accelerometer. Then I added this to the player:

Constrain Attribute game.OffsetX(my integer) to Self.Position.X
Constrain Attribute game.OffsetY(my integer) to Self.Position.Y

Which I thought would sample where the actor is(?).
Then I added this onto my glow, thinking it would move based on the player actor since I flipped the attributes:

Constrain Attribute Self.Position.X to game.OffsetX
Constrain Attribute Self.Position.Y to game.OffsetY

I'm a GS newb but this looked like the correct method from the demos. Any assistance in my dumbassness would be appreciated. :)

Comments

  • gamedivisiongamedivision Member Posts: 807
    did you check out tshirtbooths constrain one actor to another
    http://www.youtube.com/user/GameSaladCookbook#p/u/47/JnlxvMlPG-k
  • HotwireHotwire Member Posts: 24
    Yeah, the only difference is I'm using the Accelerometer to move the player so I tried to modify his example but I can't get it to work. He's sampling the mouse position which doesn't apply to my actor. I tried to insert Game.Accelerometer instead of mouse position but no luck. Also he's using a Rule that activates this by the mouse again and I couldn't figure how to replace that to fit my Tilt control either. :(
  • old_kipperold_kipper Member Posts: 1,420
    Create two game real attributes and constrain them to the player position x and y and then constrain the glow x and y to the game attributes with the offset you want added. I think this will work...

    hope it does and good luck but I am not sure that it is any different to your first attempt...

    kipper
  • NinjaworxNinjaworx Member Posts: 20
    haha, glad I'm not the only one stuck on this. Thanks Kipper, I'll play around with it and let ya know.
  • NinjaworxNinjaworx Member Posts: 20
    Yeah, didn't work. :( Basically the same as I had before. I'm not sure where I'm screwing up since it seems to be a very simple task that I even pulled from the Tourch Demo. Maybe it's because my scene isn't standard 480x320? I don't think that should mater though. I'll test it.
  • old_kipperold_kipper Member Posts: 1,420
    it should not matter what size the scene is

    cheers kipper
Sign In or Register to comment.