• 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 Tyler Starr · Feb 07, 2011 at 12:16 AM · 2dcontrollermove

2d Platform Controller Face Help

Im using the 2d Platform Controller. It works great but i want my character to face in the direction i am moving. How can this be done? If there is a tutorial or script to do this that would be great...

Thank You!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Justin Warner · Feb 07, 2011 at 02:55 AM

If it's 2D... Make it so if player pushed A, than rotate the player 180, if player pushed d, than rotate the player another 180, and just have it so that here...

var lastRotate

if player pushes a AND lastRotate is 1

then turn 180 lastrotate = 0;

if player pushes d AND lastRotate is 0

then turn 180 lastRotate = 1;

If that makes sense...

Good luck!

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 Justin Warner · Feb 07, 2011 at 02:55 AM 0
Share

By the way, I'm coding so it keeps the format.

avatar image Tyler Starr · Feb 07, 2011 at 09:05 PM 0
Share

I don't understand how to implement this into my game. Any Help?

avatar image Justin Warner · Feb 08, 2011 at 01:10 AM 0
Share

It's psuedo code, you'll have to code it your self.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

"sneak mode" (ctrl key) stops my movement. 0 Answers

iOS Tap to move?? 2 Answers

2d move to point script help 0 Answers

Very Simple Left and Right Movement Script [OR] disable dravity on CharacterController? 2 Answers

2D Movement Problems 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges