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 Matthew 1 · Sep 25, 2010 at 08:42 PM · cameramovementcharacteraxis

Newbie Question

Hey everyone,

I apologize for asking the most basic of questions here, but I've been at this for several hours and just can't wrap my head around it.

What I'm using: The move and camera scripts from the Lerpz demo. What I'm trying to do: Move my model only with the "W" and "S" keys (vertical axis). I want the model to rotate/controller to "turn" without moving using the "A" and "D" keys ( horizontal axis). Additionally, and this is the part thats giving me the most pain: I want the model to always "face forwards" so that it doesn't flip and face the camera.

Essentially, it's similar to a tank movement control, but I can seem to keep it all working. I've found some code with varying degrees of success and done a lot of the tutorials, but still not working too well.

Can anyone help with what tools I should be looking to, or any guides? As I'm trying to learn, I don't necessarily just want the JS and unity code.

Thanks!

Comment
Add comment · Show 4
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 Will 7 · Sep 26, 2010 at 12:18 AM 0
Share

Why don't you post the script you have at the moment so it's easier to help you?

avatar image skovacs1 · Sep 28, 2010 at 07:42 PM 0
Share

This is 2 questions - 1 about controlling movement and another about controlling the camera. For the camera part, have you tried something like one of the smooth follow cameras or simply making the character a parent to the camera? For the movement controls, controller.$$anonymous$$ove would move you and transform.Rotate would turn without moving.

avatar image TRiToNDREyJA · Jan 27, 2013 at 11:31 PM 0
Share

on the smooth follow script, CRAN$$anonymous$$ up the rotation damping. your character wont turn to face the camera.

avatar image AlucardJay · Jan 28, 2013 at 03:58 AM 0
Share

How about you change the title of your question so that it actually describes the question. Something like trouble with Input Axis , am sure you would get more traffic than with your current title Newbie Question , that describes about 90% of the questions here....

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Gizmoi · Jan 28, 2013 at 12:58 AM

Your best bet would be to parent the camera to your character, then have a script on your player that does as you describe.
W moves the player forward - transform.Translate(0,0,1, Space.self) - S moves backwards.
A and S rotate the player - transform.Rotate(0,10,0).

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 PAHeartBeat · Jan 28, 2013 at 04:42 AM

Hi

If you are using controller scripts of unity, your model / player will turn using mouse movement, In character have a mouse look up script to rotated player..... and as "TRiToNDREyJA" said Smooth Follow Script will make camera always see you model from it's back so user can see what happing his forward side.

If you want to face model to camera, you need to create a new other script for cam follow

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

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

MouseWheel Lerp Smoothing Problem 1 Answer

Camera relative movement 0 Answers

How can I align Axis? 0 Answers

Keep Camera from player at a certain distance while orbiting around player 2 Answers

character turning where he looks 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