Constrain Attributes

DimensionGamesDimensionGames PRO Posts: 993
edited November -1 in Working with GS (Mac)
Hey all! I have a actor (hammer) which is constrained to another actors position (Character) which in turn is interpolating to somewhere else on the screen. I have a timer every 0.01 change the attribute to the x and y of the character. Then the hammer is constrained to the two attributes so it is where the character is.

My problem is it is very juddery. Am i going about this the wrong way?

Cheers :)

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Get rid of the timer and it should be fine because once it's constrained it will always stay in position.

    You can also constrain to different places around the character by changing the constrain self.position.X to characterX+40 for eg (this will contrain him 40 pixels to the right of you character).

    Darren.
  • DimensionGamesDimensionGames PRO Posts: 993
    utopiangames said:
    Get rid of the timer and it should be fine because once it's constrained it will always stay in position.

    Darren.

    Thanks :)
  • DimensionGamesDimensionGames PRO Posts: 993
    utopiangames said:

    You can also constrain to different places around the character by changing the constrain self.position.X to characterX+40 for eg (this will contrain him 40 pixels to the right of you character).

    Darren.

    Yer I had been playing with that :) I got rid of the timers and it didn't stay constrained :(

    This is what I have:

    Hammer:

    Change Attribute self.Position.X to game.Player X +100
    Change Attribute self.Position.X to game.Player Y +150

    Character:

    Interpolate attribute self.Position.X to 9728
    Duration 50
    Function Linear

    Change Attribute game.PlayerX to self.Position.X
    Change Attribute game.PlayerY to self.Position.Y

    Control Camera

    Cheers :)
  • UtopianGamesUtopianGames Member Posts: 5,692
    Not sure without seeing the project but...

    Looks like you need to do this in the hammer instead of change attribute do..

    Constrain Attribute self.Position.X to game.Player X +100
    Constrain Attribute self.Position.Y to game.Player Y +150

    Darren.
  • DimensionGamesDimensionGames PRO Posts: 993
    woops i meant to right constrain attribute :L I would ask if you could look at the project but im guessing you will be working on either your awesome platformer or RW.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Pop it over to toyboxuk[at]hotmail.com and i will have a quick look at it.

    Darren.
  • DimensionGamesDimensionGames PRO Posts: 993
    Thanks sooo much :D how can i send it by email? :s
  • UtopianGamesUtopianGames Member Posts: 5,692
    Any luck, did it work how you expected?

    Darren.
  • DimensionGamesDimensionGames PRO Posts: 993
    Just trying :) thanks a lot :) Iv been ill today so my only two priorities were sleep and GS lol
  • DimensionGamesDimensionGames PRO Posts: 993
    You recommended move to so should I just put the position to the place I want it to go because it didn't work when I did that :/ Did you use move to for RW with the main actor?

    Cheers
Sign In or Register to comment.