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

Question

I was very impressed by the game Please login or register to see this link. and I looked for a similar code to associate with player movement a time variation. I tried different methods with Please login or register to see this link. , but the result is not very smooth. I joined the slow motion script like in FPSKit. It's work, but result not really fine. Do you have any idea about the principle or you have known a similar code? Thank you for your help + +

Please login or register to see this code.

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts


  • 0
Please login or register to see this quote.

Do you have some code - a little example to understand please? Thx boys ++

Share this post


Link to post
Share on other sites
  • 0

As DaBoss stated:

Time.timeScale = controller.velocity.magnitude / maxMoveSpeed;

//needs to add an extra 0.1 to the equation

& Bentowny:

if(Time.timeScale != curTimeScale)

{

Mathf.Lerp(Time.timeScale, curTimeScale, smooth); //wouldn't use Time.deltaTime

But check my syntax, just throwing it together

Share this post


Link to post
Share on other sites
  • 0

Thx OcularCash. I understand idea. I'll try it today ++

Share this post


Link to post
Share on other sites
  • 0

When you aren't moving at all in the game, it seems like the Timescale is set to 0.01 so then the input can still function. I don't think interpolating is required but it doesn't matter.

Share this post


Link to post
Share on other sites
  • 0

I found a solution with your help, and it works pretty well, but I have another problem with the animations, which remain at 24 fps per second. As a result, there is a jerk when Time.timeScale is ten times lower. How to solve this problem to gain fluency. Thank you to you + +

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

I found the solution to keep a fluid animation like in SuperHot game.

Must change some values on board "Edit / Project Settings / Time"

 

Fixed Timespeed 0.02 to 0.006. It's work fine ++

Share this post


Link to post
Share on other sites
  • 0

Again i got an answer. How i can affect the Time.timeScale using the mouse - button and axis ?

I search a code or an explanation about this function but nothing i found. Have you some idea ?

Share this post


Link to post
Share on other sites
  • 0

Молодец !!!

Ещё раз ты помогал мне браток. Огромное спасибо тебе ++

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...