Yes changing Time.timeScale will slow down the entire project. You can use Time.unscaledTime to reference your other scripts and they will be un-affected by any change made in Time.timeScale. You can also use Time.unscaledDeltaTime too.
I have a player1 movement script, a player 2 movement script and the share a timer.
I want it so when player 1 hits the “slow down” object Player 2s movement script will be slowed down but not the timer and then the opposite when player 2 hits the ball
Well, there’s only one flow of time in Unity, and as far as I know you can’t modify individual Rigidbodies sampling of said time. You can however modify the forces you apply to rigidbodies, but you will need to modify them all yourself, including gravity and drag. Try just multiplying your forces with 0.5f when slowed, though not sure how accurate the simulation would be.
Ye i tried to multiply my Addforce by 0,5 but then it takes too long for it to get up in a good speed so it cant get enough speed for the different jumps, thanks for your help tho - now i understand time better
I don’t think I mis-understood. Create a timer using ‘unscaled’ time. That way it will be unaffected by any changes you make in Time.timescale. Also you’ll want to cache your Rigidbody rather than using GetComponent over and over. You would also probably be better off using a Event rather than all the if conditionals.
Try this guy out. It will give you a nice GUI in the inspector. From that GUI you can call functions (events) to any other script in your project. You probably still need the if conditionals but this will be much more flexible as you can send events from one place to anywhere in your project.
import UnityEngine.Events;
//these are your events that will be added to the inspector. Once you see them hit the "plus sign" add the object you want to send an event to and connect it with the function you want to call.
var thisIsMyFirstEvent: UnityEvent;
var thisIsSecondEvent: UnityEvent;
function Update(){ if (Input.GetKey(KeyCode.W)) thisIsMyFirstEvent.Invoke(); } //this invoke is how you call your event