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
2
Question by Phim · Jun 19, 2013 at 11:39 AM · c#movement3dgridgeneration

Grid based movement in 3D environment

(Picture from google to explain the question)

We are working on a turn-based top-view tactical game. We want our character to move based on mouse click. When clicked the character will move to the designated tile.

I'm thinking that in order to achieve this we need to generate a grid based on the 3d level model. The grid also needs to be able to detect level difference in height.

This images has a texture that shows the tiles of the grid.

alt text

Is this the correct approach? Can I get some directions on how to implement this kind of grid generation?

  • edit --

We just had another idea, we could get the axes of the map model and draw a 3d wireframe grid with gizmos. Then we can position path nodes by clipping to the wireframe which are walk-able / climbable terrain for our character.I would also appreciate feedback on this.

red-d3d-bic4dvr-01.jpg (46.1 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

1 Reply

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

Answer by Phim · Jun 21, 2013 at 10:33 AM

Solved!

  1. Render grid gizmos based on given size (or attach gameobject to take X, Z from)

  2. Grid level can be changed with CTRL + and CTRL -

  3. CTRL W performs a raycast on mouse position, if location hit and Y axis within grid level (ex: Level 1 = Y axis between 0 and 1, usefull when dealing with stairs) a Waypoint is placed.

  4. Waypoint is empty game object with Waypoint script (gizmos wireframe circle in editor)

  5. On execution the connection between waypoints is determined by a script based on the height of a way point. (so stairs are climbable, but you can't go up a level without them)

Image of current result in the editor. (Grid level 1) alt text


gizmos.png (54.8 kB)
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

16 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

Related Questions

Having trouble with grid movement 1 Answer

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

How to move character in a grid-based area? 1 Answer

3d grid of game objects - C# errors 1 Answer

Best way to move my player (3d) 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