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 Injourn · Feb 03, 2016 at 03:40 AM · inputactionrecord

I there a way to record player input and play it back once the game has stopped?

I understand that this is a very awkwardly phrased question but what i am trying to ask is if there is a way to record what i input into the game ( such as if i press play and press jump) that I can unplay and make a gameObject do that action or, possible more, actions. I will try to explain more if I am not clear

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Dibbie · Feb 03, 2016 at 07:31 AM

I dont fully understand what your trying to do, why you would want to track if a person jumped in your example, but if you simply mean to just have a way to store data on the user, like a "save game" almost, you could look into something called PlayerPrefs. There actually pretty simple to use.

This information is kept after the game ends, if you dont delete the Key afterwards. I have no idea where its saving this information to, but its kept with the game after you finish playing your game.

Usage Example:

 //C#
 
 int jumps = 0;
 
 if(Input.GetKeyDown(KeyCode.Space)){
 //if the user presses the spacebar key
 
 jumps++;
 
 PlayerPrefs.SetInt("jumpCount",jumps);
 
 }
 
 if(Input.GetKeyUp(KeyCode.Space)){
 //After the use presses the spacebar key, show them their stored jump count
 
 print(PlayerPrefs.GetInt("jumpCount");
 
 }


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 cjdev · Feb 03, 2016 at 09:24 AM 0
Share

On Windows PlayerPrefs are stored in the registry, so they're actually separate from the game although they do stick around.

avatar image Dibbie cjdev · Feb 03, 2016 at 12:14 PM 0
Share

Ah ok, thats interesting, I didnt know that it works specifically in that way, thanks for the added information.

avatar image
0

Answer by itsharshdeep · Feb 03, 2016 at 08:01 AM

You can also save the the list of the actions in the list (or something) which player has performed. Then call that event manually ..

Like player has input Right turn > Jump > Left turn > Slide and then he dies.

Suppose, you want to show the replay or you want to show the bot ( dummy player to demonstrate what the heck you have done) .

Now the events you have tracked ( lets say in 'PlayerTrackerList' ) , call manually each event with the exact time interval to demonstrate the same actions that user has done ..

*Note :- This is theoretical definition or approach. It may be vary upon the project requirements.

May be someone even more better approach.

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

44 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

Related Questions

SteamVR Beta Input Action Issue 1 Answer

problem when using 2 actions map in new Input system. 0 Answers

Syntax for accessing a certain Input Actions' properties via script... 0 Answers

Saving player input and playing them mirrored 0 Answers

New Input System only sometimes registering release of key 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