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 NikSpace · Nov 20, 2010 at 12:58 PM · transformplayervector3translate

How the player can translate 1 "unit" and not smouthly.

that i want is to move the player between cubes (1.1.1)

and be in the center of the cube.

let me draw it ^^

alt text

this could be possible with Vector3 ??

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
0
Best Answer

Answer by Jesse Anders · Nov 20, 2010 at 01:09 PM

I would just set the position of the player directly, e.g.:

transform.position = <...position that you want to move the player to...>;

You could move the player relatively (e.g. using Transform.Translate()), but it's at least a possibility that this could introduce numerical error over time. This is probably unlikely to happen if the centers of the squares fall on integer coordinates, but if you simply assign the new position directly, you won't have to worry about it.

Comment
Add comment · Show 2 · 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 NikSpace · Nov 20, 2010 at 02:19 PM 0
Share

no i want the player to move every time i press the button for 1 unit per second...

when i use this code the player move smoothly but i want i snap to the next point

if (Input.Get$$anonymous$$ey ("up")){ transform.Translate(Vector3(0,0,1)); }

avatar image Jesse Anders · Nov 20, 2010 at 03:26 PM 0
Share

I guess I don't understand your question then. Is it Get$$anonymous$$eyDown() that you're looking for?

avatar image
0
Best Answer

Answer by NikSpace · Nov 20, 2010 at 04:46 PM

i find it... i am not really sure how it work. i read the code and confuse me a little but is what i was looking for..

is a code for 2D move

http://www.unifycommunity.com/wiki/index.php?title=GridMove

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 NikSpace · Nov 20, 2010 at 05:17 PM 0
Share

but still is not what i am looking for exactly :/

I want to make a snake game 2.5D has anyone had done this?

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

No one has followed this question yet.

Related Questions

how to make a character resume after going into a random battle? 1 Answer

Different between transform.Translate() and Vector3.MoveTowards? 1 Answer

Move GameObject along a line according to the players look direction 3 Answers

Move child objects in the opposite direction of parent object 0 Answers

Simultaneously translating and rotating 2D sprite? 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