• 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 /
  • Help Room /
avatar image
1
Question by a-hacker · Sep 08, 2016 at 03:05 AM · pathfindingparent-child

A* Pathfinding on a moving object - Moving pathfinding grid

Hello all, didn't know if this was the right place for this, but i've got a question and need an answer so here goes...

I've been racking my brain trying to make a working pathfinding system for my game. Every single pathfinding solution i've found is a static grid, the path is found and is travelled, but it doesn't follow with a parent just hangs out where it was initialized.

My game takes place on a grid based construction spaceship actually moving and rotating through space(not faking it somehow by scrolling a background or something) and it has crew that need to path around the ship to get to their jobs. I have yet to find, or create, a system that allows this.

Does anyone know of a A* pathfinding solution that fits the bill? One that can actually operate as a child of another moving object with all of the pawns staying on the grid, that again, is moving with a parent?

I will literally put you in the credits of my game if you can help me, lol. Seriously though, any help would be greatly appreciated, thanks.

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 Benjames · Sep 08, 2016 at 05:49 AM 0
Share

You could translate the position and rotation based on the grids current transform. Say your grid is 0-100 width and 0-100 height and it moved to 45,112 then whatever A*object Position is you subtract 45,112. The rotation I can't remember exactly but I think you just call position*quaternion.inverse(). I would look at some code I have. or mess with a little bit but I think its inverse.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by a-hacker · Sep 08, 2016 at 05:31 PM

I can't add a comment because i don't have permission (good one UA). This is not an answer.

@Benjames - sounds logical, i'll try to do that. so far my attempts to modify the A* project i have (that i've used before and works great) haven't worked out... but i'll go through it again.

@Hellbound_01 - Granberg's project was one of the first I tried, given it's high acclaim in similar questions. It is really awesome, but still doesn't fit my project. That path made is still a static path, it doesn't travel with it's parent as I have yet to find. I will go through it again though. If you know something about it that i don't, please let me know.

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 Lechuza · Apr 22, 2017 at 12:02 AM 0
Share

I was just wondering if you figured out a solution to your problem? as it is the same problem I am having. Hope to hear back from you as I cannot find an answer myself, I looked everywhere.

avatar image
0

Answer by Hellhound_01 · Sep 08, 2016 at 12:45 PM

You should try out the A* Pathfinding project from Aron Granberg. On his project page you could also get a slightly reduced but powerfull free version: http://arongranberg.com/astar/

This project covers most of the pathfinding requirements and contains several pahtfinding graph solutions. Another advantage of this project is a strong community forum where Aron itself is active.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make an object move from Point A to Point B then back to Point A repeating 9 Answers

Display maximum movement range with a non-grid-based system 0 Answers

2d NPC pathing 0 Answers

How to exclude certain navmesh obstacles on runtime? 2 Answers

A* Pathfinding Issue 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