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 Arkgain · Dec 19, 2012 at 07:53 AM · movementcharacterrangestrategy

Character movement range in strategy game.

I have a turn based strategy game and I want to limit character movement to some degrees, like a character can only moves inside an allowed range, like in a circle shape. So how should I create said circle, with collider maybe? And if it is possible to recognize Input mouse position in the circle?

Comment
Add comment · Show 2
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 Alec Thilenius · Dec 19, 2012 at 07:59 AM 0
Share

Sorry, the question seems too general to answer. Is it tile based? Is it 2D? How do you want to compute 'max distance'?

avatar image Arkgain · Dec 19, 2012 at 09:12 AM 0
Share

No, it is not tile based, since it is turn based, I will have to adjust gameObject's present position anytime it finishes its move. And from the position it currently is at the beginning of the turn I would have to check how far it can moves again. Does this explain a bit better? I'm using Nav$$anonymous$$esh to control the characters.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by CodeMasterMike · Dec 19, 2012 at 09:04 AM

As Alec Thilenius said, a very general question indeed. There are many ways to do this ofcourse, but my sollution would be something like this:

First create a grid with squares/hexagons, which covers the map where the player can move.

And to limit the movement, you could create a circle to show where the user can move. And when the user clicks in this circle, raycast to see which square/hexagon in the grid the user has clicked on, and move the player to this position. Using a grid like this, makes it easier to implement a A* for pathfinding for example.

The player doesn't need to see that there is a grid, you just use it to determine where the player can and can't go.

I hope this gives you an idea or inspiration of how you can do it :-)

Good luck!

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 Alec Thilenius · Dec 19, 2012 at 07:32 PM 0
Share

Exactly what I was thinking. Just use a pathfinding algorithm (Like A*) to deter$$anonymous$$e the actual walking distance. See if it is within an acceptable range.

avatar image Arkgain · Dec 20, 2012 at 02:12 AM 0
Share

Oh I see, Actually I'm still thinking about the game system and if it is possible for me to do it, I haven't got much experience about Unity yet. I will try to do it.

avatar image
0

Answer by ifonlyme1000 · Sep 22, 2020 at 07:48 PM

https://www.udemy.com/course/turn-based-strategy-game-development/ Turn based game dev tutorial like heroes of might and magic

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

12 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

Related Questions

problem with 2d movement down slopes 0 Answers

Original Blender character faces ground when not walking 2 Answers

wanna know what make my char stop 0 Answers

Standard asset question 1 Answer

How to handle walls with my FirstPersonCharacter? 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