Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by PinpointGames · Jan 03, 2015 at 04:16 PM · movement script

how do i script wasd movement into my game

i am new to unity and trying to make a free to play game and i looked everywhere for a code to move with the wasd keys but then I import them or copy them it says that there is a error with the codes can you please help me ThankYou

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by UnityKen · Jan 03, 2015 at 04:36 PM

I think you should watch the unity tutorial videos, It will teach you a lot of the basics including movement. Just click on learn at the top if the page and then tutorial.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by YoungDeveloper · Jan 03, 2015 at 04:17 PM

I think the unity docs are quite good in that area. http://docs.unity3d.com/ScriptReference/Input.GetKey.html

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PinpointGames · Jan 03, 2015 at 04:27 PM 0
Share

thank you very much but I am still having trouble finding out what all this means I have only coded a mod for $$anonymous$$ecraft

avatar image YoungDeveloper · Jan 03, 2015 at 04:31 PM 0
Share

Please, read it carefully and try to understand. Here's a simple example.

Create a c# script, name it Test$$anonymous$$ove and copy-paste this. Place it on some gameobject in the scene and run the game.

 using UnityEngine;
 
 public class Test$$anonymous$$ove : $$anonymous$$onoBehaviour {
     void Update() {
         if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.A))
             Debug.Log("Pressing A");
         
         if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.W))
             Debug.Log("Pressing W");
 
         if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.S))
             Debug.Log("Pressing S");
 
         if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.D))
             Debug.Log("Pressing D");
     }
 }

You will see a debug on the keys you are pressing.

avatar image PinpointGames · Jan 03, 2015 at 04:46 PM 0
Share

it is regerstring it now what? becasue it is not moving thanks by the way

avatar image YoungDeveloper · Jan 04, 2015 at 11:28 AM 0
Share

Here's how to move gameobject transform http://docs.unity3d.com/ScriptReference/Transform.Translate.html you are welcome by the way

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Isometric movement 3 Answers

Laggy Movement 1 Answer

Platform Mover continued 1 Answer

whay cant i move with this script???? 3 Answers

Trouble making Dynamic Billboard 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges