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 yoda1521 · May 01, 2012 at 04:00 AM · movementtop-downtop downdowntop

Top-Down Shooter Motion

I started to work on a top down shooter where the player moves the mouse to aim in that direction. I wanted to have the player move up, down, left, and right an the when the WASD/ arrow keys are used, but it will only move in it's own x and y axis, so when you rotate the player half a rotation, D moves it left and A move it right. i can't figure out how to modify the current script i have (FPSWalkerEnhanced: http://unifycommunity.com/wiki/index.php?title=FPSWalkerEnhanced) to do this. Please help.

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 chainedlupine · May 02, 2012 at 04:20 AM 0
Share

I presume you mean you want your player to move left or right relative to its current facing direction?

avatar image yoda1521 · May 02, 2012 at 10:54 PM 0
Share

no i want it to move relative to world position, so when you hit up, the player moves up and likewise for the other directions

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Seth-Bergman · May 02, 2012 at 05:02 AM

Sounds like you want the player to face where the mouse cursor is, while the movement is directly relative to world, rather than players rotation.. if so, I think just maybe eliminating this line (to keep the world coordinate system) just might do it:

moveDirection = myTransform.TransformDirection(moveDirection) * speed;

maybe... It pops up a couple of times, just delete them all, I think

edit: of course, if you want to keep the speed intact you should replace the line above with:

moveDirection = moveDirection * speed;

careless of me...

Comment
Add comment · Show 1 · 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 yoda1521 · May 02, 2012 at 10:52 PM 0
Share

when you get rid of the TransformDirection() function the object doesn't move anymore. (it still rotates, but thats irrelevant) i need a function that moves the object and doesn't use something like myTransform.TransformDirection(moveDirection) or at least find a way to make a TransformDirection relative to world space

avatar image
0

Answer by ProfArithmetic · May 03, 2012 at 01:29 AM

I have a project that I am working on that is a top down game as well so i know the confusion at first. I would recommend this link to a very good walk through of what a 2d top down shooter really is.

http://www.rebelplanetcreations.com/downloads/Other/Tutorials/HowToMakeAGameInUnity3D.pdf

Hope that helps

Comment
Add comment · Show 1 · 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 gamergath · Apr 30, 2014 at 12:03 AM 0
Share

Great tutorials on your PDF! :D

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

7 People are following this question.

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

Related Questions

Unity2D AI for Top Down Zelda-Type movement 1 Answer

Enemy strafing AI Top Down 0 Answers

How can i move a game object up and down so it acts like a obstacle for my sphere player 4 Answers

Top down 2d character controller sometimes walking backwards 1 Answer

My top-down movement is really jittery, any idea how to fix? 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