Added: 2 years ago
From: John8pie
Views: 5,403
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (90)

Sign In or Sign Up now to post a comment!
  • What andyman2016 said!!!

  • My character faces the mouse but for some reason he can't walk or shoot!!! Please help me!!!

  • THANK YOU SO MUCH

  • 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

  • LOL itunes fail at 0:50

  • 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 You should be using global.d

    Global with a period immediately after,

  • @John8pie it keeps shooting to the right

  • 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

    easier to explain in a video

    if i send you a video it will come from Hakansson20's channel

  • @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

  • Nvrmnd i forgot to set the origin to the center, but how do i do that

  • @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?

  • cld u make a vid how to move arm up in down in a platform shooter?plz?

  • @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 if u dont wanto make a vid just tell me how to make da arm move on my character to the mouse.:)

  • @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 thx but how do u make the arm jump in the position?

  • @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 but what if the arm connects to a different place on my sprite's body?

  • @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 oh yeah, i never thought of that. :) thanks so much

  • Comment removed

  • @John8pie im having a hard time with this ;( could u make a simple vid?

  • @xQFxifagodatyaho Sure. If I find some time soon, I will see what I can do.

  • 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,d­irection); ^

    at position 28: Unknown variable d

  • @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",direct­ion);

    // Note the quotation marks making the variable a string.

  • 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 Have you declared the variable 'motion' in the create event?

  • @John8pie yes no i done that and it works! thx!

  • 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 You have a typo.

    directon. It should be direction.

  • @John8pie WHOA i fail

  • @brainbash1 XDDD I do agree.

  • i love how the player sprite is called Car XD

  • em... what do i do when i want an object to move to another object...?? please!!! really need help !!! T_____T

  • @TimeTravelerJK Just the action we used in the video. The moving object has the step event code 'move_towards_point(OTHEROBJEC­T.x,OTHEROBJECT.y,speed)'

  • @John8pie make a tutorial pleeeeeeeeeaseeeeeeeeee

  • @sonsofajackass Make a tutorial on what?

  • @John8pie if I want to move with an analog joystick as an achievement to do that

  • @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;

  • dude ur amazing! thanks very much!

  • 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 I'm thinking you have the syntax reversed. Try global_d = direction;

    Instead. Let me know how that works out for you...

  • @John8pie help me i got the same problem dude i cant find it out

  • @robotmaster123 Did you try reversing the syntax, like I explained in the previous comment?

  • @TheMechn Also, you want global.d. As in with a period, not an underscore.

  • Comment removed

  • Yay! i get a cookie!

  • Secound code! :D

    move_towards_point(mouse_x,mou­se_y,motion)

  • @despenseren You guys deserve a cookie and a half, really,

  • for those who want a short cut for the first code

    image_index = image_number * direction / 360

  • @MrParkour223 Thanks man! :D

  • @KillSteal666

    What are the origins of your arm and body sprites? That could be the case...

  • this was great help, continue making your videos :)

    - Origarti

  • @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?

  • @Zheet7 That should work fine, I am a bit disappointed it isn't working out for you.

  • thx so much. i was looking for a simple face the mouse and shoot. ^_^

  • 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

    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

  • is this for game make 8 pro cuz i have light

  • @xXxXDarthKingXxXx This should work fine with Lite.

  • when your player moves the screen moves with it and mine dosent how do i do that?

  • @member3195 I believe I have a video on how to do that.

  • 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...

  • 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.

  • 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 Oh of course, sorry man, I'll do that next time in other videos.

  • 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 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?

  • awsome work, some mistakes, but i went back and found them. works 100% thanks.

  • @superdvdman Hahha, great, thanks so much. What were some of the problems, if you don't mind telling me?

  • ok it works fixed it but i dont know how :) ty anyway

  • ok... i can move... but i cant shoot at the mouse it can only shoot in one direction :/ help me pls

  • @whosyourdaddya

    Did you set the bullet's direction to global.d (or whatever variable you had set)?

  • awesome

  • Thanks for this tutorial! It helped me a lot

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more