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 Rosscoe3 · Mar 11, 2016 at 08:34 PM · scenesavereplay

Instant replay??

Hi all, so i'm trying to implement an instant replay in my game, and haven't found much on the subject. I have a bow and arrow game where you shoot at a target, and then i wanted to replay that action you just did, but view it from a different camera angle. I wasn't sure if this was something that was so incredibly complicated it wasn't worth doing, or something possible.. thanks :D

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 Jessespike · Mar 11, 2016 at 09:06 PM

incredibly complicated is relative. It's as simple as storing and restoring the states of the scene objects. There are assets on the store that can help if it's too complicated or if you want to save development time:. https://www.assetstore.unity3d.com/en/#!/search/page=1/sortby=relevance/query=replay

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

Answer by rodude123 · Mar 11, 2016 at 09:37 PM

Well you could get the starting point of the arrow like this:

 public GameObject arrow;
 void Start()
 {
     arrow()
 }
 void arrow()
 {
     oArrowX = arrow.position.z;
     oArrowY = arrow.position.y;
 }
 
 void OnCollisionEnter(Collision collider)
 {
     if(collider.gameObject.CompareTag("target"))
         nArrowX = arrow.position.x;
         nArrowY = arrow.position.y;
         replay()
     else
     //do something e.g. say you missed the target
 }
 
 void replay()
 {
     //here move the arrow in some way back to the new position started
     //and then destroy it after a second or so using WaitForSeconds(x)
     // x being the number of seconds
 }

Whats happening there is you are getting the position of the arrow when it started and when it finished and then you are getting the position of the arrow when it finished and moving from start to finish again. I have left some blank so that you would have to do some yourself as I will not do it all for you

here is a camera follow for arrow

 public Transform arrow;
 
     // Update is called once per frame
     void Update () 
     {
         transform.position = new Vector3 (arrow.position.x + 6, 0, -10 );
 
     }
 }

remember to put it in 2 different files and attach the camera follow to the arrow. When using this camera find out a way to disable the main camera and enable the new arrow camera. You may want to change the arrow.position.x to arrow.position.y or arrow.position.z depending on which direction you want to show it on.

Hope it helps.

@rodude123

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

39 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

Related Questions

Have 1 Big Object or Multiple Smaller Objects 2 Answers

One JSON file, multiple objects, multiple scenes... 0 Answers

Saving player input and playing them mirrored 0 Answers

How can I load sprite from previous scene? 1 Answer

PlayerPrefs working on PC but not on Android. [2020] 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