Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (222)

Sign In or Sign Up now to post a comment!
  • I get a error saying:

    Assets/Movment.js(10,31): BCE0020: An instance of type 'UnityEngine.Transform' is required to access non static member 'position'.

  • OMG this looks god damn hard!

  • I cant make a javascript because i dont have the project tab that you have...

  • @MinecraftishPerson Right click on any tab, hover over 'Add Tab', and click on project :)

  • it say 'Unknown Idientifier : 'Backward'..... please help me !!

  • nvm I got it

  • hey i couldnt see wat code you wrote for A and D, it just kind of swiped to another part of your vid and then your video of yourself was blocking it. wondering if you could just write wa you put in the code

    Thanks

  • Not very experienced in code, but im guessing your using C# language right?

  • @ZachsEdits Java Script, check out codeacademy . com for tutorials

  • Assets/bob.js(18,39): BCE0050: Operator '-' cannot be used with an expression of type 'error'.

  • @zerak9494 O_O

  • Comment removed

  • nevermind sorted it! :P

  • since it's java why is it var instead of int or double or string or whatever

  • @MrDiablo5222 this is javascript, they are not the same

  • @andersmelen It's painful when people think they are the same.

  • @MrDiablo5222 its not Java, its Java Script

  • Nice video, you're not only teaching unity but trying to explain programming concepts along the way. That's a mammoth task. Good luck!

  • Perfect tutorial. But what if i want to use mouse to change the angles and keyboard just to transform positions. Like a FPS game. I need a hint to google it :)

  • @jonuroral Hmmm, YT is being a bit of a PITA WRT replying to you, so I guess just go here: pastebin DOT com/RhUbenaP

  • @truevox Do'h! I forgot, in my script, what you want "a" to be is "q", and "e" is what you'd want "d" to be. Sorry!

  • @jonuroral Oh, and I'm still learning Unity3d myself, so please forgive me if anything offered at the below link is wrong/not clear enough.

  • @truevox np of course. after spending some time on google, I got what I need. thanks for the reply anyway.

  • know where i can get a character modeling software

  • @thaDaniroy Look up AutoDesk 3D Studio

  • Everything works 100%, grate tutorial :)

  • Comment removed

  • for a RTS game If I add this to the main camera will it work?

  • Keys "w", "a", "s", "d" doesn't work in Mac. Why? It's okey when i use arrows - GetKey(KeyCode.UpArrow)

  • NullReferenceException: Object reference not set to an instance of an object

    Boo.Lang.Runtime.RuntimeServic­es.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)

    Firstscript.Update () (at Assets/Firstscript.js:21)

    Help? Please? It will not run, I get an error message at the bottom that says that.

  • @BCK1D5 Looks like its trying to execute a Boo script when you have a javascript

  • hey man, love the videos so far. this doesnt have to do with this video in particular but i need help with a script for me to pick up something with a RigidBody (i.e. a cube) and be able to pick it up then push it out. i almost had it but i did something wrong and crashed unity and i was using Raycasters on Physics and i just need a propper code so when i left click it will pick it up and when i right click it will push it forward.

  • my move code works only if i don't add the Time.deltaTime. Does this mean my computer is too fast for the code?

  • @Hamgamgo I realize this has been a while, but not. That is not possible. And the editor is always clamped at a max of 60 frames/seconds, but even if you "publish" the game and run it as an .exe, that is not possible.

  • Comment removed

  • var moveSpeed:float = 1.0;

    function Update ()

    { if(Input.GetButtonDown("Forwar­d")) { transform.position += transform.right * moveSpeed * Time.deltaTime; } if(Input.GetButtonDown("Backwa­rd")) { transform.position -= transform.right * moveSpeed * Time.deltaTime; }

    }

    I have that, but I have to tap my buttons to get him to move forward, how can I make it so that I cna hold the buttons and have him move.

  • @RPGking001 change the Input.GetButtonDown to Input.GetButton

  • Okay, I used my imagination and did so I could move up and down. But how can I prevent myself from falling through blocks and "planes"?

  • So I wrote it out as shown, but I was hoping to move continuously by holding down whatever button I assign and at the moment, whenever I hold a button it only moves once. How would I change that? Thanks.

  • i made the script and it is completly right, the speed is right and the input is all right, but i cant move up down left or right, and yes i did add the letters for the keys to move. Please Help

  • Hi! I'm following our tutorial...It is really strange..everithing is working fine except that the forward movement...I press "w" but anything happens. here a piece of my script:

    if(Input.GetButton("Forward")) { transform.position += transform.forward * objMoveSpeed * Time.deltaTime; }

    Thanks and cheers

  • you need to move your head.

  • hey can anyone please help i got these errors on my script and i don't know what to do. " Assets/movement.js(23,33): BCE0034: Expressions in statements must only be executed for their side-effects. " what does that mean i checked the script and rechecked, help would be nice. someone tell me what i messed up on this next comment.

  • This is really frustrating, i have done the same things like you but when i try to move NOTHING happens... I have checked the Scrupt 20 times and I havnt done any mistakes in it.. wtf is the problem? :S

  • @nedbear1970 i know right, i have the same thing to, maybe its he has an older version, i got the 3.3 version of unity so i think the scripting works differently

  • Comment removed

  • Hi! Thanks for your great tutorials!

    I'm following them and wrote the script etc..EVERYTHING works except for the Forward button ("w"). The strange thing is that if i change it in the input mapping to any other key ("e", "r", "t", for istance) it works great! But not with "w"...what am i doing wrong?

  • @no1r Lets see your script so i can fix it for you man.

  • Do you know how to write a script that lets you aim the position of where the camera is facing with the mouse? Like in FPS games.

  • @narutolll hey naruto, first import the standard assets(if mac) or the scripts package(if windows), then find the 'MouseLook' script and put it in your camera. =)

  • Yes, it's pronounced "Oiler." Euler was one of the world's greatest mathematicians. He practically invented math.

  • @infiniteammoinc hey i want to creat a sprint movement so for multiple inputs at once would it be something like Input.GetButtonDown("Run" && "W"))

    would that work or is there a proper way to do it.

  • @BeyondTaking Close, it'd be like

    if (Input.GetButton("Run") && Input.GetButton("W"))

    Check the Unity Script Reference for "Input" :)

  • @infiniteammoinc do you have any tutorials on how to do that like mass physics ( a giant tower made of like planks that fall down)

  • @infiniteammoinc Im having speed problems what is the optimum movement speed for a game like GTA or WoW?

  • hey, i have a question for you, how to make objects like wall or floor to be solid?

    i've tried the mesh collider with rigidbody but it didn't work.please help me!!! ASAP

  • Comment removed

  • Anyone ever notice how the first tutorial for something can have a huge amount of views.. but no, not once you get to the second video! seriously... can people not commit?

  • Because I just got Unity today and I want to start making a movie before the summer ends.

  • I'm 14 and I'm just about to go into 9th grade so am I supposed to know how to script or am I supposed to learn this in high school. Where do I learn it?

  • @SupermanSmallville1 I am, too.Well... scripting isn't exactly something you learn in an average school. You might be able to go to a college or university of some sort that offers that as a class, or an elective. That's not going to be your best bet at learning to script.Just started this tutorial a while ago, and if you follow along,you will get a bit of understanding of what you are doing.You can also look into some other languages after doing some research to see which one you think is easy

  • Comment removed

  • Comment removed

  • genius....

  • Hmm, i have copied the code exactly to be sure, but the CPU seems to expect "(" instead pf "{" at the entry line for the coding, and "EOF" (end of function?) instead of "}" Any help would be appreciated

  • @ShandyOzaki You have a typo. I'd try looking for mismatched { and }. If you can't figure out, I'd scrap it and try rewriting it.

  • HOW THE FUCK DO YOU FIX "input button backwards is not setup"!!!!!!!

  • @gamercritic101 look in the project setting under input again, where he showed setting up Forward Backward ect... make sure you have the "backwards" input in however you want it called. It's disappeared for me before so check that first.

  • can someone give me specific detail on how to change the input code so that it works with "wasd"?

  • @gamercritic101 Read up on the Input Manager settings docs. Google search: "unity reference Input Manager"

  • When i push on Forward it only does it one time except if i push again.. i want that it refreshes the key like you . If you keep on pushing it keeps going forward.

  • Instead of Forward Backward Left Right I stuck with wasd and it dosent apear to working.

  • I have a pc, is there any way i can use this script editor? :p

  • When i try to run my game i get this error message:

    Assets/NewBehaviourScript.js(8­,35): BCE0051: Operator '+' cannot be used with a left hand side of type 'float' and a right hand side of type 'UnityEngine.Vector3'.

  • What Scripting engine are you useing ?like to write scripts in mine only bolds in blue yours does diffrent colors also.

  • @merccc1 The scripting engine he is using is java. Maybe your using C Sharp

  • @KunkoFilms2 i meen like the editor Im using built in one and I now see that you can modify it to show diffrent colors XD

  • @KunkoFilms2 There is a distinction between Java and Javascript

  • @Cordelles3 Yah but since unity doesn't have both java and javascript he will understand waht i mean.

  • @merccc1 same here... you've got a PC, am I right?

  • @merccc1 He probably has a different version of Unity. Mine is also different to his

  • bij mij werkt dat niet

    (nederlands)

  • var moveSpeed = 1.0;

    var turnSpeed = 1.0;

    function Update ()

    if(Input.GetButton("Horizontal­")) { transform.position += transform.forward * moveSpeed * Time.deltaTime; }

    if (Input.GetButton("Jump")) { transform.eulerAngles.x += turnSpeed * turnSpeed * Time.deltaTime; }

    if(GetButton("Vertical"))

     { transform.eulerAngles.y += turnSpeed *turnSpeed * Time.deltaTime;

    it wont work, im trying to make a spaceship.. help!

  • @jordannw2010 there's so much wrong here... it might be helpfull to move the {

    code...code..code

    }

    to seperate lines, like I did above...

    secondly, you don't need semi colons within {}... that might be messing things up for you

    and why do you multiply turnSpeed twice? turnSpeed squared? this is what you want if you want your spaceship/plane to pitch:

    if(Input.GetButton("up"))

    { transform.eulerAngles.x += turnSpeed * Time.deltaTime;

    }

    the up is referring to the arrow key

  • @tarrizzzzzzzzz thanks lol , i was VERY new to scripting then, thankyou for the answer though, and when i saw *turnSpeed* i thought that meant something like ' this script uses the variable named turnspeed, therefore you have to put that every time you use it ' you should look at almost everything in detail for one or two tutorials so this doesnt happen :D

  • @jordannw2010 sorry for double posting, but:

    if you want it to behave like a real air plane, you would want it to rotate on it's z axes, and then pull up on the x axes to actually turn (which would to us seem like turning on the y axes)

    btw, for pitching down, use my code, but replace ("up") with ("down") and += with -=

    PS: you can use any word instead of up and down, for example UpArrowKey, or something else, either way you have to specify the actual button in the input.

  • @jordannw2010 alright, sorry for posting AGAIN, but i was wrong.. yes, you DO need semi colon withing {}... sorry :p

    uhm, and you can apparently use vertical and horizontal, i didn't know that :p I'll start using that!

  • @jordannw2010 I need to stop doing this, but I wrote a short script for you... you CAN NOT use vertical and horizontal, as you need to define which way it should turn...

    sorry to bother you like this, but to be fair, you said help :)

  • @tarrizzzzzzzzz you arent bothering me xD thanks for all the help i appreciate it

  • there's no errors in mine, but when i press D for right, the camera moves right and backward, whereas when i press A for left, it pans like it should. any idea what this might be?

  • Assets/NewBehaviourScript.js(1­,21): UCE0001: ';' expected. Insert a semicolon at the end.

    I'm fairly new, and I tried to copy your script, but this is what I got... I don't know where to put the semi colon, could someone please help?

  • how can you cpnect a script to a variable?

  • Comment removed

  • Comment removed

  • Can someone help me with these errors?

    Assets/Script 1 - test.js(15,19): BCE0020: An instance of type 'UnityEngine.Transform' is required to access non static member 'position'.

    Assets/Script 1 - test.js(23,37): BCE0005: Unknown identifier: 'speed'.

    Assets/Script 1 - test.js(27,19): BCE0020: An instance of type 'UnityEngine.Transform' is required to access non static member 'eulerAngles'.

  • @CrackpotWeevil My guess would be a typo. Because the human brain is generally pretty shoddy, you'll miss a lot of mistakes even if you think you're looking closely. Keep in mind that the distinction between upper case and lower case matters. i.e. Typing Transform.position vs. transform.position = two completely different things.

  • ur better than my teacher in uni

  • ur beteer than my teacher in uni

  • I was copying you cuz I am new to this but near the start I couldn't see the bottom line of the scripting and when I wanted to test it the game said there was a compiler error, thanks any way u have helped me alot and i understand the interface now.

  • i was wondering if my inpiuts just wont work

  • my camera doesnt jump!

    at the bottom of the screen it says unity exception: input button "jump" is not setup????

  • My camera don't "jump" can you help me?

  • My Unity is free and I have a little problem with using [+=] in this line

    transform.position += transform.forward * moveSpeed * Time.deltaTime;

    It's appear to be ERROR ?

    So I use == instead and my camera didn't move - -

    Help Me pls T T

  • @forjustice You're not going to get a lot of help if you don't provide specifics. i.e. What error messages did you get? My guess is you have a typo somewhere else in your code, even if you think you can't see it. I'd try rewriting parts of it and see if you get the same errors.

  • @forjustice you canot use == you need a singel = becouse == is for shekking your variables hopes thes helps

  • can someone tel me whats rong with this line

    moveSpeed + 0.1;

  • @sinmasterj moveSpeed += 0.1;

  • thanks alot ive scripted before but dident know any of the functions or shit for this language

  • Thank you dude

  • can u send me these scripts by email or somthing? i dont wanna write em down on paper... and should i stop trying to use Unity3d because i dont know java language???

  • says its "expecting a EOF '}'"

  • I got problem with my script. It says "Assets/Bob.js(19,72): BCE0051: Operator '*' cannot be used with a left hand side of type 'UnityEngine.Vector3' and a right hand side of type 'System.Type'." and "Assets/Bob.js(19,79): BCE0005: Unknown identifier: 'deltaTime'." What should I do? I am using Windows Vista. Is it different from Mac?

  • thanks this has helped me learn unity alot easier im checking out the rest of your videos without your help I would have been so done for =)

  • hey i was wondering what is a good book on how to script (java script) please reply :S

  • Great videos, they're helping me so much for my video game design class!

    Also, loving the tegan and sara in the back : )

  • im downloading Unity right now, watching your vid, and learning Java script all at the same time... EPIC

  • heyy can u pm me when u first started to design and script

  • When i hold W it walking forward and when i hold S it walking forward to. When i hold d it rotate Right when i hold A it rotate Right to. What have i did wrong?

  • @n00btroop Check that any values that should be negative are. It can be easy to miss in the video.

  • Comment removed

  • You said "Zee" this time. What's up with that?

  • I cant move I added all of the codes.

  • Just out of curiosity, how the heck did you learn to do this and where did you go?

  • How can you setup a yek, like i can't use W for some reason....

  • im having trouble looking LEFT and RIGHT it just moves the camera, i used the link at your website for the movement script so i dont know whats wrong

  • If you mention geek think of this guy.

  • @diggygoggy "geeks" like him make the games you play, program the websites and softwares you use, and made the computer you are sitting right know, have a little respect if it was an insult

  • Comment removed

  • Comment removed

  • you are awsome, great tutorial.

  • Thx for the tutorial. Youtube + guy like you making education system obsolete.

  • 15.000e

  • dude i made a game were u navigate through a maze but i can just walk through the walls what can i do to stop this?

  • dude i made this first person controller script by watching your vid but when i try it out it doesnt wor can you help me? ill post my script in the next comment and anybody is free to use it }

    }

  • THANK YOU!!!! I WAS LOOKING FOR HOW TO SCRIPT WITH ACTUAL BUTTONS!!

  • It says "input button W is not a setup" help!

  • really useful, thanks.. there need sto be a free course in unityscript, explaining from beginning to end how to use it basically.. >.>

  • thanks for getting me started with unity :D its always this wall of starting to learn a new program that keeps me from actually learning it lol

  • Thank you so much

    code has always been ruining my game creating opportunities

    I feel a little safer now

  • hmm there comes a message, there standing i cant mofide a euler Angle :(

    Cannot modify the return value of `UnityEngine.Transform.eulerAn­gles' because it is not a variable

  • can you set the script at 18 secound in the chatt :)?

  • Could u send me the entire script? i dont understand shit about scripts

  • WHY CANT I FIGURE OUT SCRIPTS!!!!!!! >.<

  • @aggressivegeek SERIOUSLY SAME HERE!!!!!!!

  • @superfartdog Maybe you should try some basic scripting languages before jumping into JS. :P

  • @aggressivegeek pisses me off 2 D:

  • Thanks Guy. Awesome tutorials. I found that 'transform.eulerAngles.y += x amount;' works just fine. Don't really get the point of turn speed even though it's cool I guess. But anyway, this tutorial helped me out heaps so thanks!

    P.S. you look like Noel Fielding.

  • how did you change what keys do what

  • cool tutorial. Only issues are that your webcam section blocks out the script at the end, and you kind of rushed through setting up the input tab.

  • If you don't know what is a variable this video is totally useless man!!

    Obviously this is a reference video for those who already know programing and unity also, but you then teach about the basic Ui commands in unity!

    This tutorial is a mess, but useful for someone like me, i don't want to be rude, just i want to make a constructive criticism, you have to define the tutorial goal, the target audience and then restrict the topics to that target.

    Btw thanks for the video!

  • my camera dont rotate it just goes left and right

  • @sticksanity Compare your code to that in the video, and see if you can notice any differences. With programming, if you can't tell what's wrong right away, it's probably something subtle. Then again, it's quite possible that it's really obvious and you're just not seeing it yet. :) (happens to everyone)

  • @infiniteammoinc do u have a tutorial on textures? if u dont pls consider making one. pls reply.

  • @infiniteammoinc Your face is covering that part of the code.

  • @sticksanity you must have used transform.position for "A" and "D" which is wrong, because when you push A and D you want it to "turn"(change angles/rotate), so you should use transform.eulerAngles.blah blah blah...

  • can you do a tutorial on how to change yahoo profile pic

  • @poundsounds2009 that is fucking hilarious at just how dumb you might be.

  • I'd like to see how to make the player walk up hills and have gravity etc.

  • I WANT TO MAKE FPS GAME!!!

  • Cool! I am looking into Unity, and it looks really cool. The scripts and UI remind me a bit of Maya, but better, WAY better. I would say the only problem with this tutorial is that your face gets in front of the code quite a lot.

  • Yup. Was using GetButtonDown. Allowed it to seep in from code commented out in first part of the tut. Thank you very much for your reply! I think I'm starting to have fun learning to code :~).

    Now, going to work on the jump so the character goes up and comes back down smoothly. Obviously, GetButtonDown won't do the trick. Have to learn about gravity, hehe. I do have code I can coopt and learn from in the Unity documentation. Going through the 3d platformer tut now. Thx again!!! :~)

  • Everything seems to be working correctly, except that in your vid it seems like you're getting continuous movement while holding a button, whereas I get one movement with each button press. Are you having to repeatedly press a button to get continued movement?

    I attempted changing the "if" statements with "while" thinking it would work, but no luck so far. I'll keep working on it, but feedback appreciated ~ and thanks again for the tut :~)

  • You may be using GetButtonDown instead of GetButton? Get ButtonDown only returns true when the button goes down. After that it returns false. GetButton returns true if the button is down, false if it's not.

    You don't need to use a while loop. (Update gets called every frame from the main loop)