hi i have a few problems and a question. (I can make a video about it)
first my bullet wont go toward the mouse, and it wont face it either. and ive done the same thing as you?
also i dont want it to shot 100 bullets in one sec or something. i want it to shot 1 in 1 sec how do i change that
when i press the left button on the mouse i want my weapon to apear and follow me (or stick to the player). when i tried to do that when i move it creates many weapons when i hold my right button
@totalspelnerd Hey, uhm.. i think what you can do is make an object and name it something, than what you do is when your player shoots he creates that object, what you put in your player is that when that object is in the room it doesn't shoot, after 1 sec you'll make the object go away and then your player shoots a bullet again.
@Kittyinmynose Open the sprite, and on the right hand side of the window you should see it's preview. Look for a button that says 'center' and that's all you have to press.
Thx! it works fine till my soldier has collision with the cursor, in which case it thrashes around violently north and south of the cursor. I went back and checked all the code though. what did i do wrong?
@xQFxifagodatyaho Of course, I'd be happy to. I'm working on a complete redesign of my website and tutorials, so when I have a chance I will try to make one. Obviously, if I forget please remind me.
@xQFxifagodatyaho All you would really do is create an arm sprite and object, and have them constantly jump to the position of the player. Then have the arm object face and look towards the mouse, like done in this video. Any other questions, like if you need to this done in legit code rather than an explanation, just let me know.
@xQFxifagodatyaho In the sprite of the arm and/or the player, set the origin to correspond with the other. Like if the player's origin was in the center, set that to the arms as well.
@yujibolt90 Happy to see you're doing it in GML code. With that function, though, variables are passed as strings. And you don't need to specify using the preceding 'global.'. So your function should really look like:
variable_global_set("d",direction);
// Note the quotation marks making the variable a string.
@TimeTravelerJK Just the action we used in the video. The moving object has the step event code 'move_towards_point(OTHEROBJECT.x,OTHEROBJECT.y,speed)'
@sonsofajackass I don't have an analog joystick to debug with; but I know there are a ton of functions Game Maker has that can let you do that. Should I just trust it and try it any way, even if I haven't got one myself? o.o;
@member3195 Goto the room-settings and ... I don't know! Watch a tutorial on YouTube to find that out. Just Search: Game Maker Make Camera following Player
Heeey, i used this for an arm, so that i could have a shooting platformer. For the arm, in step, i used jump to position: X = ObjectBody.x and for Y i did ObjectBody.y It works, except the arm kinda lags behind the body when i move. Is there a better way to get what im going for?
I'm thinking the 'directer' value should be 'direction'. Try that. Unless you have a variable 'directer' set to 'direction', that should be the problem.
instead of "GLOBAL RIGHT BUTTON", you really should use "GLOBAL RIGHT PRESSED", so it could shoot once, and not keep firing! see, in my game, i move if you hold "SPACE" and i shoot with the left mouse button pressed. its alot easier that way i think!
@brazothegr8 Create the arm as a sprite, then turn it into an object. Have it constantly be in the position of the player, so it works like a, well, arm. xD Then apply all the codes I covered in the video to the arm object. Hope this helps, if you have any other problems please ask.
@Gentner24 Set the speed to a variable. This way you can control what the speed is, whenever you'd like. I believe this is in the video. If you have any other questions or need more help, please comment or message me, I'd be happy to help.
What andyman2016 said!!!
Shaklesforlife 1 week ago
My character faces the mouse but for some reason he can't walk or shoot!!! Please help me!!!
mrpickleful 2 weeks ago
THANK YOU SO MUCH
andyman2016 1 month ago
ERROR in
action number 3
of Step Event
for object player:
Error in code at line 1: move_towards_point (mouse_x,mouse_y,motion) ^
at position 37: Unknown variable motion
cooperwolf22 3 months ago
LOL itunes fail at 0:50
LiveEnjoyment 3 months ago
plz help
___________________________________________
FATAL ERROR in
action number 1
of Create Event
for object player:
COMPILATION ERROR in code action
Error in code at line 1: global d = direction ^
at position 8: Variable name expected.
z4chpoz 6 months ago
@z4chpoz You should be using global.d
Global with a period immediately after,
John8pie 5 months ago
@John8pie it keeps shooting to the right
ninjagamexpert 7 months ago
hi i have a few problems and a question. (I can make a video about it)
first my bullet wont go toward the mouse, and it wont face it either. and ive done the same thing as you?
also i dont want it to shot 100 bullets in one sec or something. i want it to shot 1 in 1 sec how do i change that
when i press the left button on the mouse i want my weapon to apear and follow me (or stick to the player). when i tried to do that when i move it creates many weapons when i hold my right button
PLEASE HELP!
totalspelnerd 8 months ago
@totalspelnerd
easier to explain in a video
if i send you a video it will come from Hakansson20's channel
totalspelnerd 8 months ago
@totalspelnerd Hey, uhm.. i think what you can do is make an object and name it something, than what you do is when your player shoots he creates that object, what you put in your player is that when that object is in the room it doesn't shoot, after 1 sec you'll make the object go away and then your player shoots a bullet again.
I hope this works, let me know what you did
bye
BlackHawkNiels 8 months ago
Nvrmnd i forgot to set the origin to the center, but how do i do that
Kittyinmynose 10 months ago
@Kittyinmynose Open the sprite, and on the right hand side of the window you should see it's preview. Look for a button that says 'center' and that's all you have to press.
John8pie 10 months ago
Thx! it works fine till my soldier has collision with the cursor, in which case it thrashes around violently north and south of the cursor. I went back and checked all the code though. what did i do wrong?
Kittyinmynose 10 months ago
cld u make a vid how to move arm up in down in a platform shooter?plz?
xQFxifagodatyaho 10 months ago
@xQFxifagodatyaho Of course, I'd be happy to. I'm working on a complete redesign of my website and tutorials, so when I have a chance I will try to make one. Obviously, if I forget please remind me.
John8pie 10 months ago
@John8pie if u dont wanto make a vid just tell me how to make da arm move on my character to the mouse.:)
xQFxifagodatyaho 10 months ago
@xQFxifagodatyaho All you would really do is create an arm sprite and object, and have them constantly jump to the position of the player. Then have the arm object face and look towards the mouse, like done in this video. Any other questions, like if you need to this done in legit code rather than an explanation, just let me know.
John8pie 10 months ago
@John8pie thx but how do u make the arm jump in the position?
xQFxifagodatyaho 10 months ago
@xQFxifagodatyaho In the arm object's step event, have a code execution say:
x = PlayerObject.x
y = PlayerObject.y
Obviously you should fill in the 'PlayerObject' with the name of your player object.
John8pie 10 months ago
@John8pie but what if the arm connects to a different place on my sprite's body?
xQFxifagodatyaho 10 months ago
@xQFxifagodatyaho In the sprite of the arm and/or the player, set the origin to correspond with the other. Like if the player's origin was in the center, set that to the arms as well.
John8pie 10 months ago
@John8pie oh yeah, i never thought of that. :) thanks so much
xQFxifagodatyaho 9 months ago
Comment removed
xQFxifagodatyaho 9 months ago
@John8pie im having a hard time with this ;( could u make a simple vid?
xQFxifagodatyaho 9 months ago
@xQFxifagodatyaho Sure. If I find some time soon, I will see what I can do.
John8pie 9 months ago
i need help
ERROR in
action number 1
of Create Event
for object object0:
Error in code at line 1: variable_global_set(global.d,direction); ^
at position 28: Unknown variable d
yujibolt90 10 months ago
@yujibolt90 Happy to see you're doing it in GML code. With that function, though, variables are passed as strings. And you don't need to specify using the preceding 'global.'. So your function should really look like:
variable_global_set("d",direction);
// Note the quotation marks making the variable a string.
John8pie 10 months ago
plz help for me it says: ERROR in
action number 3
of Step Event
for object player:
Error in code at line 1: move_towards_point (mouse_x,mouse_y,motion) ^
at position 37: Unknown variable motion
ixXgamerXxi 1 year ago
@ixXgamerXxi Have you declared the variable 'motion' in the create event?
John8pie 1 year ago
@John8pie yes no i done that and it works! thx!
ixXgamerXxi 1 year ago
ERROR in
action number 2
of Step Event
for object guy:
Error in code at line 1: image_index = image_number * directon / 360 ^
at position 30: Unknown variable directon
brainbash1 1 year ago
@brainbash1 You have a typo.
directon. It should be direction.
John8pie 1 year ago
@John8pie WHOA i fail
brainbash1 1 year ago
@brainbash1 XDDD I do agree.
John8pie 1 year ago
i love how the player sprite is called Car XD
theninjaguppy 1 year ago
em... what do i do when i want an object to move to another object...?? please!!! really need help !!! T_____T
TimeTravelerJK 1 year ago
@TimeTravelerJK Just the action we used in the video. The moving object has the step event code 'move_towards_point(OTHEROBJECT.x,OTHEROBJECT.y,speed)'
John8pie 1 year ago
@John8pie make a tutorial pleeeeeeeeeaseeeeeeeeee
sonsofajackass 1 year ago
@sonsofajackass Make a tutorial on what?
John8pie 1 year ago
@John8pie if I want to move with an analog joystick as an achievement to do that
sonsofajackass 1 year ago
@sonsofajackass I don't have an analog joystick to debug with; but I know there are a ton of functions Game Maker has that can let you do that. Should I just trust it and try it any way, even if I haven't got one myself? o.o;
John8pie 1 year ago
dude ur amazing! thanks very much!
robotmaster123 1 year ago
hey there is something wrong when i shoot the bullet... there is an error and it says
ERROR in
action number 2
of Create Event
for object Bullet:
Error in code at line 1: direction = global_d ^
at position 13: Unknown variable global_d
what do i do??
TheMechn 1 year ago
@TheMechn I'm thinking you have the syntax reversed. Try global_d = direction;
Instead. Let me know how that works out for you...
John8pie 1 year ago
@John8pie help me i got the same problem dude i cant find it out
robotmaster123 1 year ago
@robotmaster123 Did you try reversing the syntax, like I explained in the previous comment?
John8pie 1 year ago
@TheMechn Also, you want global.d. As in with a period, not an underscore.
John8pie 1 year ago
Comment removed
TheMechn 1 year ago
Comment removed
TheMechn 1 year ago
Yay! i get a cookie!
despenseren 1 year ago
Secound code! :D
move_towards_point(mouse_x,mouse_y,motion)
despenseren 1 year ago
@despenseren You guys deserve a cookie and a half, really,
John8pie 1 year ago
for those who want a short cut for the first code
image_index = image_number * direction / 360
MrParkour223 1 year ago
@MrParkour223 Thanks man! :D
John8pie 1 year ago
@KillSteal666
What are the origins of your arm and body sprites? That could be the case...
John8pie 1 year ago
this was great help, continue making your videos :)
- Origarti
Origarti 1 year ago
@member3195 Goto the room-settings and ... I don't know! Watch a tutorial on YouTube to find that out. Just Search: Game Maker Make Camera following Player
ThePC007 1 year ago
Heeey, i used this for an arm, so that i could have a shooting platformer. For the arm, in step, i used jump to position: X = ObjectBody.x and for Y i did ObjectBody.y It works, except the arm kinda lags behind the body when i move. Is there a better way to get what im going for?
Zheet7 1 year ago
@Zheet7 That should work fine, I am a bit disappointed it isn't working out for you.
John8pie 1 year ago
thx so much. i was looking for a simple face the mouse and shoot. ^_^
lildude546 1 year ago
Though it seems like nothing is wrong, my game says...
___________________________________________
ERROR in
action number 1
of Create Event
for object Player:
Error in code at line 1: global.d = directer ^
at position 12: Unknown variable directer
Can you please explain the problem because i went through the tutorial 3 times and i didn't find a single problem D:
howlocanureallygo 1 year ago
@howlocanureallygo
I'm thinking the 'directer' value should be 'direction'. Try that. Unless you have a variable 'directer' set to 'direction', that should be the problem.
Hope it helps --
John
John8pie 1 year ago
is this for game make 8 pro cuz i have light
xXxXDarthKingXxXx 1 year ago
@xXxXDarthKingXxXx This should work fine with Lite.
John8pie 1 year ago
when your player moves the screen moves with it and mine dosent how do i do that?
member3195 1 year ago
@member3195 I believe I have a video on how to do that.
John8pie 1 year ago
Does somebody now how to make somthing like this only with worms guns,bazukas,etc. i tried, but i think the sprite of my worm has to less images...
pichuranger 1 year ago
instead of "GLOBAL RIGHT BUTTON", you really should use "GLOBAL RIGHT PRESSED", so it could shoot once, and not keep firing! see, in my game, i move if you hold "SPACE" and i shoot with the left mouse button pressed. its alot easier that way i think!
GOATtubers 1 year ago
@brazothegr8 Create the arm as a sprite, then turn it into an object. Have it constantly be in the position of the player, so it works like a, well, arm. xD Then apply all the codes I covered in the video to the arm object. Hope this helps, if you have any other problems please ask.
John8pie 1 year ago
@brazothegr8
John8pie 1 year ago
@Gentner24 Set the speed to a variable. This way you can control what the speed is, whenever you'd like. I believe this is in the video. If you have any other questions or need more help, please comment or message me, I'd be happy to help.
John8pie 1 year ago
can u just put a GML code in the description please? i realy dont like to sit and watch a video i just like to copy and paste a code lol...ty man
mnmboy9147 1 year ago
@mnmboy9147 Oh of course, sorry man, I'll do that next time in other videos.
John8pie 1 year ago
Hi, i have a problem! Could you tell me how to make it so that the character can move? For some reason it only glitches when I press those buttons.
entish01 1 year ago
@entish01 What's going on that's wrong? I believe I covered how to move in the video, can you give me a bit more detail on what's happening?
John8pie 1 year ago
awsome work, some mistakes, but i went back and found them. works 100% thanks.
superdvdman 2 years ago
@superdvdman Hahha, great, thanks so much. What were some of the problems, if you don't mind telling me?
John8pie 1 year ago
ok it works fixed it but i dont know how :) ty anyway
whosyourdaddya 2 years ago
ok... i can move... but i cant shoot at the mouse it can only shoot in one direction :/ help me pls
whosyourdaddya 2 years ago
@whosyourdaddya
Did you set the bullet's direction to global.d (or whatever variable you had set)?
John8pie 2 years ago
awesome
thekingofkings342 2 years ago
Thanks for this tutorial! It helped me a lot
gigabowser212 2 years ago