Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to simulate Obi Rope physics?
#1
When i use in unity
Code:
Physics.Simulate(Time.fixedDeltaTime);
The Obi Rope is not simulated. Do I understand correctly that Obi Rope need to be simulated in a separate script? If it is true, how i can do this?

I'm developing a game where i need to detect in my server that user actually wins. My full code of simulation process:

Code:
private void Start() {
    Physics.simulationMode = SimulationMode.Script;
    Simulate();
}

private void Simulate() {
    GameObject machine = Instantiate(machinePrefab);
    MachineController controller = machine.GetComponent<MachineController>();
    APIMachineControlStateRequest request = JsonUtility.FromJson<APIMachineControlStateRequest>(json);
    controller.SetSimulate(Physics.defaultPhysicsScene);
    foreach(MachineControlState state in request.value) {
        controller.SetState(state);
        Physics.Simulate(Time.fixedDeltaTime);
    }
}
When i start it, Obi Rope behave unpredictably
Reply


Messages In This Thread
How to simulate Obi Rope physics? - by oleegarch - 21-02-2024, 06:09 PM