Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by hilmimarzuqi · Mar 07, 2016 at 03:43 PM · ai2d-platformerkeypressbehaviourghost

Is there a way to implement a ghost mode where a ghost can replay the best possible solution of a set of data?

My idea is that my 2D platformer game has obstacles in it and a player has to navigate it through obstacles after a few tries to get a set of input data.

So then, I can tell it to change to 'ghost' mode whereby i cant press anything but a ghost will substitute me based on my previous tries and gets an efficient route.

An example of a controller to store keypresses would look something like this.. actions[0].milliseconds = 400 actions[0].action = right pressed actions[1].milliseconds = 1000 actions[1].action = jump pressed actions[2].milliseconds = 1300 actions[2].action = jump released actions[3].milliseconds = 2500 actions[3].action = jump pressed actions[4].milliseconds = 3000 actions[4].action = jump released actions[5].milliseconds = 5330 actions[5].action = right released

..but I have no idea on how to pass this to the 'ghost' character.

I would plan it out like this - Have a player go through the game a few times to get input data - Allow the player to tell the current Active Character to enter Ghost mode. - Reset the Character. This will place them back at the starting position. They will in turn tell their Controllers to reset to millisecond 0 with no keys pressed. - And from here the ghost will show how the player behaves

Comment
Add comment · Show 3
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 meat5000 ♦ · Mar 07, 2016 at 03:53 PM 0
Share

This is something you need to simply try. Search "unity ghost car" in google for examples.

avatar image Glurth · Mar 07, 2016 at 05:15 PM 0
Share

I'm not sure I understand what you need. It looks like you already have an array of actions, are you unsure how to pass that array to your ghost class? I would assume the ghost class has a place to store the action array, why can't you simply assign it to that member, when you instantiate/switch to the ghost driver? Or, are you trying to figure out how to store the actions and times into the array, in the first place?

avatar image hilmimarzuqi Glurth · Mar 07, 2016 at 11:32 PM 0
Share

Yes, I am unsure how it is to pass it to the ghost class or rather the algorithm that is needed to make sure the ghost class can replace the current active character

0 Replies

· Add your reply
  • Sort: 

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

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

Related Questions

How to automatic reference another GameObject Transform? 1 Answer

Help with 2D AI scripting 0 Answers

A* Pathfinding and keep the enmy at range 0 Answers

Ally AI shoot arrow 0 Answers

Enemy character floats while he moves back and forth 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