Jump to content


Photo

Weapon facing same direction as player


  • Please log in to reply
4 replies to this topic

#1 Migsta

Migsta

    GMC Member

  • GMC Member
  • 173 posts
  • Version:Unknown

Posted 20 August 2012 - 07:19 PM

I have a character and a pickup item (axe) When the character picks up the item I have the axe animated sprite assigned to a keyboard button. So when the button is pressed it will play the axe swinging.

My control scheme is W(forward) S(reverse) A(rotate left) and D(rotate right) and SHIFT is my axe attack button for now.

He's the problem, my axe swing sprite won't face the direction that the player is facing while standing still androtating. BUT, if i'm moving forward AND rotating it works fine(faces the same direction as the player)

I need it to face the direction while rotating and not moving forward.

I must be missing something...it almost works...

Thanks!
  • 0

#2 smash ball

smash ball

    Volcanic Light

  • GMC Member
  • 1117 posts
  • Version:GM7

Posted 20 August 2012 - 07:42 PM

If it works while moving forward, then you need to move some of your code or remove a check. Without seeing any of your code, I can't help you much.
  • 0

#3 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1848 posts
  • Version:GM:Studio

Posted 20 August 2012 - 08:04 PM

Can you show some code. It's kind of hard to guess solutions without seeing how you're doing things.
  • 0

#4 The Legend

The Legend

    A Jesus Freak

  • GMC Member
  • 1052 posts
  • Version:GM:Studio

Posted 20 August 2012 - 08:08 PM

based on what you have said you need the axe objects image_angle to equal the image angle of the player sprite.

just punch in image_angle=player_obj.image_angle

Make sure to replace player_obj with your player objects name
  • 0

#5 Migsta

Migsta

    GMC Member

  • GMC Member
  • 173 posts
  • Version:Unknown

Posted 21 August 2012 - 03:35 AM

based on what you have said you need the axe objects image_angle to equal the image angle of the player sprite.

just punch in image_angle=player_obj.image_angle

Make sure to replace player_obj with your player objects name



That did it! I knew it was going to be somthing simple...lol Thanks!!!!!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users