Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
geckoo

Time.timeScale equal to 1 for a sound, but...

Question

In a program I use controller.velocity to change the variable Time.timeScale (see for example SuperHot game). The code works well. The sounds are changed and the effect makes a good slide. I have another problem. I try desperately to keep one track (background music) with a Time.timeScale equal to 1. I can not maintain its independence. It is inevitably influenced by the general Time.timeScale. Is there a way around this obstacle? I tried using a static variable, but it does not work. Thank you very much for your help + +

 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

i assume you change audio pitch on all audio sources when you change time scale.

you can try to lock pitch on this audio source:

Please login or register to see this code.

Share this post


Link to post
Share on other sites

  • 0

Извини меня друг мой, я не мог объяснить точно на английском языке свою проблему.

Я хочу независимо от Time.timeScale сохранить для одной музыки audio.pitch = 1.0.

Остальные звуки изменяются когда я двигаюсь. Понял ли ты ?
человек двигается - Time.timeScale = 1.0 and audio.pitch = 1.0
человек не двигается - Time.timeScale = 0.1 но я хочу ещё audio.pitch = 1.0 (just for one ambiant music)

Please login or register to see this code.

Хочу независимо от всего всегда слышать только одну музыку с Time.timeScale = 1.0 and audio.pitch = 1.0

Share this post


Link to post
Share on other sites
  • 0

Вопрос та я твой понел, но вроде ты не понел мой ответ :d

използуя SlowMotionSound() ты на всех аудио соурсах меняеш питч. Возми скрипт каторий я тебе дал и прикрепи к обекту на котором будет звучать ета музика и проблема решена.

Share this post


Link to post
Share on other sites
  • 0

Hum now i understand. I must attach it on the sound file. It's so easy...

I'll try. Thx спаситель мой o:-)

Share this post


Link to post
Share on other sites
  • 0

Again an answer. How create an exception in a loop "for" ?

Thx for help ++

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

I tried this alternative, but curiously, despite the logic, the pitch of the background music is always defined by Time.timeScale.

Please login or register to see this code.

 

I don't understand how i can fix this problem.

Thank you for help ++

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...