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 chris56728 · Nov 14, 2013 at 11:17 PM · c#movementlerpboardgame

Moving character to points along a board - c#

Hey guys,

I'm making a monopoly style board game where a player can move along a board.

The way I'm doing it right now is that I have a bunch of cubes that I get into an array and the character just lerps from one cube to another down the array.

The problem i'm having is that I don't want every character to not go to the exact same spot because if they do you can't see multiple character on the same cube. I tried setting up a rigid body on the character and then getting the distance between the player and the cube and if the player gets within a certain distance then stop. This doesn't work because my character get the point and then start jittering/or knocking the other character off the cube area.

Any ideas on how I can do this better?

Thanks! Chris

Comment
Add comment · Show 1
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 getyour411 · Nov 15, 2013 at 12:33 AM 0
Share

Try an XOffSet value and apply it cumulatively for every player in a square to position them somewhat differently.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by gajdot · Nov 15, 2013 at 10:42 AM

Add a parent empty gameobject for you characters and add some offset for you character with position to the parent empty gameobject. Then just move your parrent gameobject to the cube positions. This way when they are on the same cube even if the parrent empty gameobject is in the same place the caracters have an offset to each other, so they are all visible.

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 tetryon · Dec 18, 2013 at 11:08 PM

I've only been using Unity for 12 days, so take this with a pinch of salt....!

I am doing similar to you, but have opted for a one-way linked-list style of doing the cubes.

For the offsite, I have a total of four players. I've selected positions on the tile for each using offsets. Each player object stores that offsite as a number (x and z). A switch (name) call in the Awake() sets those numbers once, and they are used in the Update() by the Lerp() call. I added a RigidBody to the player object, removed gravity and made it a Kinematic. It then uses triggers to know when it hits a tile. So it passes through each tile, slowing down a little as it gets to each one. I also reduced the scale of the collider box for the tiles (using a Prefab).

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

18 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

Related Questions

Making a bubble level (not a game but work tool) 1 Answer

Movement Script 1 Answer

Vector3.lerp causes gameobject to move thousands of pixels away from where it's mean to go 1 Answer

Distribute terrain in zones 3 Answers

Why does this IF statement loop without finishing? 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