Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/AutoSim.cs

Last active May 4, 2018
What would you like to do?
using UnityEngine;
public class AutoSim : MonoBehaviour {
[SerializeField][Range(0.1f, 1.5f)] float speed = 0.1f;
private void Awake()
Physics.autoSimulation = false;
private void OnDestroy()
Physics.autoSimulation = true;
void FixedUpdate () {
Physics.Simulate(Time.fixedDeltaTime * speed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.