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 thisizmonster · Nov 15, 2013 at 02:54 PM · charactercontrollercharacter controllergrid based game

Bomberman like movement

Sorry it's my first time using Unity. If my question is too dumb or somewhere existed please easy on me.

I'm trying make some bomberman game on Unity. Camera will see it from top. And right now i'm only starting and trying make some movement. But on my current code, it's moving directions i don't want. For example, if you press W and D same time, it moving to top right corner. I still can't decide what happen if player press W and D same time. It should go top or right? Also how I disable unwanted angle movements.

 function Update () {
 
     if(Input.GetKey("w")) {
         
         transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);    
     }
 
     if(Input.GetKey("s")){
     
         transform.Translate(Vector3.back * moveSpeed * Time.deltaTime);
     }
 
     if(Input.GetKey("d")) {
         
         transform.position += transform.right * moveSpeed * Time.deltaTime;
     }
     
     if(Input.GetKey("a")) {
     
         transform.position -= transform.right * moveSpeed * Time.deltaTime;
     }    
 }
Comment
Add comment · Show 2
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 thisizmonster · Nov 15, 2013 at 03:12 PM 0
Share

hm, you are right, i hate myself.

avatar image thisizmonster · Nov 15, 2013 at 03:14 PM 0
Share

Do you know some bomberman or same game tutorial? I searched from youtube, found one bomberman but that's not on english. if you know, please give me link :)

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by gajdot · Nov 15, 2013 at 03:02 PM

Use if else statements instead of only using ifs in that way it will only record one direction and you won't get angles in your movement.

I changed it to be an answer so you can accept it. We'll I don't know any which is bomberman like, but if you have any question I'm happy to answer.

PS. I'm planning to create a tutorial channel on youtube, so if you have some special request what are you specially interested in a tutorial, maybe I can make one for you.

Comment
Add comment · Show 3 · 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 thisizmonster · Nov 15, 2013 at 03:44 PM 0
Share

Of course that's unbelievable offer for me. But i don't want you waste your time for me :(

avatar image thisizmonster · Nov 19, 2013 at 01:33 PM 0
Share

I just posted my current progress and asked few questions here. please review it, when you have some free time :) http://answers.unity3d.com/questions/578728/problems-while-making-bomberman.html

avatar image gajdot · Nov 19, 2013 at 01:45 PM 0
Share

$$anonymous$$, as soon as it gets visible I'll try to help.

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

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can i rotate my character smooth using keys ? 0 Answers

My Character Controller Is Warping Randomly (/w video) 0 Answers

How to detect angles of walls? 1 Answer

Character Controller, changing collider's size? 0 Answers

Problem with Movement Script 0 Answers


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