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 /
avatar image
1
Question by chaeljc · Oct 18, 2016 at 12:31 PM · scripting beginnergame development

how to jump to a specific time in game

Hi. Im very new to unity and game development in general. In fact this is my very first posting to any game development site or forum!!

My main interest is not so much gaming as such (boo hiss i hear you cry lol), but using unity to deliver a VR Music Video experience.

My issue is that at 'around abouts' a certain time into a song (game time) i want an object or objects to to something etc. the objects are 'reacting' to a certain part of the song. i can make the objects move ok at any particular point in the song via scripting ok, HOWEVER...

when i want to view the results of my coding - ie the events actually happening, i have to press play in unity and wait n watch until the events take place to check that their movement is having the correct desired effect.

In practice i often have to tinker with each objects timings to fine tune their effect.

As each time i have to play and wait some mins and seconds to view the result of my tinkering.. it becomes ever more annoying and time consuming.

I would be most grateful if anyone could suggest a way (Scripting??) that upon pressing unity's play button, the game (music video) starts just before my objects are about to move... so i can easily adjust and re-test etc.

Many thanks in advance

Regards Michael

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
1

Answer by tanoshimi · Oct 18, 2016 at 01:12 PM

The problem is that you're approaching Unity as a linear system, in which the animation of events is strictly time-limited, repeatable, and deterministic. In most games, this simply isn't true. The events occurring at 02:40 into a game of Super Mario Bros are different on every playthrough for every player, because they've been dependent of user input, and you can't simply jump to that part of the game without evaluating all of the preceding events that led up to that point (i.e. playing the game).

If you don't require any interactivity, you could set up all your gamebject animations to be triggered from an Animator controller. Then, using Animator.StartPlayback you can explicitly set time.value to evaluate an arbitrary frame in the animation. Likewise, you could use AudioSource.time to specify the matching time from which the audiosource should be played. However, note that depending on how you are compressing the audio, time might not be exact - it will only be a multiple of the closest audio packet start point.

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 chaeljc · Oct 18, 2016 at 07:18 PM

hi tanoshimi.

Many thanks for your quick reply. I appreciate that games generally arent linear systems. however i am wanting to use the unity environment as the arena for a 3D virtual reality (occulus rift) music video. Whilst the music is running some events will happen when a user does something, but some other things i wish to happen at specific times in the song that is playing.

i can already make them happen at 'more or less' specific times by triggering them at specific game times ...however ideally as several things are happening around the same moment I would really like to be able to jump immediately to a specific point of the song - which will in effect be at a specific point in game time (i.e time in the vr music video) ... this will let me see the timed events play out at the correct point in the music so i can fine tune them etc.

i was just wondering was there a way to jump straight to a specific game time... so that i can quickly and repeatedly observe the music and any 'syncronized' / timed events and how they perform at that time.

Kind regards

Michael

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

As a game developer is it better to use Directx or OpenGL? 0 Answers

How to make a game destroy itself once destroyed 1 Answer

increase scale to object and it make it slowly 0 Answers

how to move a puzzle piece from current position to empty position 0 Answers

Cannot Send Class Object From One Scene to Another 1 Answer


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