anyone know how to get things to stick to your character?

ownage11ownage11 Member Posts: 39
edited April 2012 in Working with GS (Mac)
I want my little rectangular block player to be able to pick up a small rectangular gun off the ground, how do i get the gun to stick to my player so it kind of looks like hes carrying it?
i also wanted to give my player little block eyes too if i could :D

Best Answer

  • ashtmjashtmj Posts: 405
    Accepted Answer
    you need to make 2 Real global attributes

    PLAYER X
    PLAYER Y

    then constrain them to the player's X and player's Y location

    then constrain what ever objects, gun, etc. to those 2 attributes

Answers

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    You could constrain the guns position to the blocks position + whatever offset you want.

    But for performance sake, youre better off just resizing the actor and changing its image to show it holding a block.
  • ownage11ownage11 Member Posts: 39
    Thanks, i looked at a youtube video and did that
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    I'm not quite sure why you rejected the answer @johnmulcahy gave you... He essentially said the same thing and was correct about having it done with images. Unless it's a rotating gun or something like that, then it will be infinitely better on processor power than constraining the e and y values to the character.

    Ace
  • ownage11ownage11 Member Posts: 39
    I rejected his answer because I was wondering how a cube block can pick up a gun, not have the gun stick to him the whole time,
    but i guess the way you do that is constraining x y , vel xy, and angular velocity, at least i think, havent tried yet though
Sign In or Register to comment.