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 /
This question was closed May 05, 2014 at 01:22 AM by AlucardJay for the following reason:

Too subjective and argumentative; not enough information given

avatar image
0
Question by Xtra Snipey · Apr 30, 2014 at 10:02 PM · boardgame

How to implement a board game movement.

alt text

Ok, so in this image i am trying to create a "boardgame" i am wondering if i can move say, 5 to the right, left, etc.

Can anyone Help?

Thanks in advance!

help.png (24.3 kB)
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

  • Sort: 
avatar image
0

Answer by KevLoughrey · Apr 30, 2014 at 10:26 PM

The easiest way to do it would be to picture the board as a grid (15 by 15 in this case), with each dot in its own grid tile. Then if you want to move 5 to the right, you increment the x position by the width of a grid tile multiplied by 5.

Comment
Add comment · Show 4 · 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 Xtra Snipey · May 01, 2014 at 06:28 AM 0
Share

How exactly would I achieve this, would I be using the transform.translate ?

avatar image rakkarage · May 01, 2014 at 06:45 AM 0
Share

transform.position = new Vector3(transform.position.x + 3 * tilewidth, transform.position.y, transform.position.z)

avatar image rakkarage · May 01, 2014 at 06:46 AM 0
Share

or maybe astar?

avatar image Xtra Snipey · May 01, 2014 at 07:51 AM 1
Share

ok with this, i have

 if (diceNumber == 1) {transform.position = new Vector3(transform.position.x + 1 * popDistance, transform.position.y, transform.position.z);}

but when i roll a "1" it continuously goes forward.

is there a snippet that makes the code run only once?

Thanks anyway!

avatar image
0

Answer by Jeff-Kesselman · Apr 30, 2014 at 10:49 PM

The question is, do you want to pop directly there or slide there? If you want to pop then the answer above is correct.

If you want to slide, then you set a velocity to the right and check on update if you are within a "fudge distance" that is about equal to your move per frame. If so then you set the velocity back to zero and then set your position in your tsrnaform as described above.

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

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Finding Edges 1 Answer

how can i set up a wall detection to enable down movement? 2 Answers

Bringing a GUI window to the front 1 Answer

Screetching Sound While Walking? Why? 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