- Home /
Slow down game and don't loose physics- Playmaker
Hi,
I working on strategy game and I would like to slow down/ pause the game. Moving and giving orders for units work well with Scale Time function on PlayMaker- its similar to Time.timeScale = 0.0 in C# (I'm not good in scripting so I use PlayMaker if I only can).
But I would like to shoot balls with physics like in Brick Shooter Unit tutorial. I did everything like they said in tutorials and balls fly nice but...
When game speed is 100% and I shoot the balls they fly nice and have range. But when I use slow down option in game and shoot balls they are slow down (it's good) but they don't fly as far as shooting without pause. When I hit pause after shoot balls their slow down but have same range like shooting without pause. Range and velosity of balls are affected only when pause/ slow down is on during shooting.
How can I keep same balls range even when pause button is on?
Kind regards
Sorry, should be "physics".
Code is from Brick Shooter Unity3D tutorial. link text Copy below:
using UnityEngine; using System.Collections;
public class Shooter : $$anonymous$$onoBehaviour { public Rigidbody projectile; public Transform shotPos; public float shotForce = 1000f; public float moveSpeed = 10f;
void Update ()
{
float h = Input.GetAxis("Horizontal") * Time.deltaTime * moveSpeed;
float v = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed;
transform.Translate(new Vector3(h, v, 0f));
if(Input.GetButtonUp("Fire1"))
{
Rigidbody shot = Instantiate(projectile, shotPos.position, shotPos.rotation) as Rigidbody;
shot.AddForce(shotPos.forward * shotForce);
}
}
}
Your answer
Follow this Question
Related Questions
Problem with Playmaker Send Remote Event 1 Answer
How to move to specific point with character controller 1 Answer
How to write debug log to txt file? 3 Answers
2d game with png sequences slowing on Unity3d 1 Answer
Unity Itween error 3 Answers