Game Maker Studio: How to Parent & Rotate Weapons?

Channel:
Subscribers:
268
Published on ● Video Link: https://www.youtube.com/watch?v=3N1UMYWg5n4



Duration: 15:09
193 views
0


Visit my MC GAMES site, got a new game coming soon, play Alien Wars BattleFront Demo:
https://bit.ly/2HJ1GxK

Paypal Donate: https://bit.ly/30e8VDZ

GMS File: https://bit.ly/2VbaT5a

If you want to pickup your weapons, see this video:
How to Collect, Cycle, & Use you're Items?
Link: https://bit.ly/3fJu92V

obj_weapon1, obj_weapon2, obj_weapon3, Depth -5 makes the gun above obj_player. Be sure they are all Parented to obj_player and use the below code. Also press Q key for all weapons, in the obj_weapon1 in the Actions: Use the Change Instance drop in to obj_weapon2, then in obj_weapon2, Change Instance to obj_weapon3, then Change Instance to obj_weapon1

Events:

Create

Actions:

target = obj_player;
myspeed = 0;
length = 0;
place = 0;

Events:

Step

Actions:

x = obj_player.x + lengthdir_x(length,place);
y = obj_player.y + lengthdir_y(length,place);
place += myspeed;

obj_player, be sure to set origins to the location you want the gun to be at on player. Depth 0







Tags:
rotate
weapon
gun
guns
learn
teach
how
move
change
shot
shoot
range
fire
origin
character
player
parent
object
obj
device
windows
android
computer
pc
game
studio
guy
brick
see
back