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 Unamine · Feb 09, 2011 at 12:33 PM · timerecordingplayback

How to create a system to go back in time as in Prince of Persia?

Well, I would like to create a system that allows the user to go back in time in the style of Prince of Persia, but I have no idea how to record the movements made, and then pressing a button, load the recording in reverse order .. .

Could you help me with some code or idea?

Thanks in advance...

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

3 Replies

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

Answer by GeekURLant · Feb 09, 2011 at 02:39 PM

Hi,

Maybe you should record the types/order of the player's animations and his movements on x seconds (or when the player can reverse time). Whenever the player's animation change, you store the animation ID an array with the player's position in the Update function.

And when the player press the "reverse" button, you read the array.

Dunno if I was clear enough but hope it will help you.

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 yoyo · Feb 09, 2011 at 05:05 PM 2
Share

Rather than trying to record all the animations and play them back in reverse order it may be easier to record the transform of the character and the transform of each bone, and then play that back ins$$anonymous$$d.

avatar image
1

Answer by pet1100 · Mar 14, 2017 at 11:43 AM

Use linkedlist. When the list is x in size you can remove the first and still add last.

And example: LinkedList reverseTime = new LinkedList();

In every update AddLast Remove first if LinkedList size is to big

Remember to do it on visible enemies.

The movement class should consist of transform (orientation and world position) and or more info depending on gamemechanics.

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 Bunny83 · Mar 14, 2017 at 12:56 PM 0
Share

Please edit your answer and mark your code as code. Also you most likely had used generic arguments which has been stripped since the weren't marked as code so they got interpreted as HT$$anonymous$$L tags and stripped away.

If you don't know how to format your code, see the user guide section "Posting Questions, Answers and Comments"

(i wish Unity would finally add anchors to their html documents. It's a pain to link to a long page without a way to go to a specific section ...)

avatar image
0

Answer by AtomicMarine · Feb 09, 2011 at 02:50 PM

Or you could make the timescale negative?

TimeScale = -1.0

or something like that, look up the TimeScale method it is used to slow down time in my game, and should be able to reverse it.

Comment
Add comment · Show 4 · 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 GeekURLant · Feb 09, 2011 at 02:58 PM 0
Share

I don't know if unity handle the "recording" part of what we are talking about ... but it would be amazing if it was this simple =D

avatar image swordofnoah · Jan 05, 2013 at 06:31 AM 1
Share

Nope, sorry. Time is simply stopped at any value less than or equal to 0.

avatar image Vonni · Jan 05, 2013 at 09:50 AM 1
Share

haha, would be sick if that worked :!

avatar image anonym4014 · Aug 07, 2013 at 03:43 PM 0
Share

@swordofnoah : Time is not stopped at negative timeScale, deltaTime is negative so movements can be inversed that way but not reversed. Furthermore Physics (FixedUpdate, Collisions, Trigger...) is not considered anymore.

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

6 People are following this question.

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

Related Questions

Play the same animation offset in time from another object? 0 Answers

Voice Recording issue ?? 0 Answers

get particles at certain time 0 Answers

360 stereo video double vision 0 Answers

Dynamic recording of objects position seems fine, playback is too fast. 2 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