Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RESET Obi Softbody
#3
(23-06-2023, 11:17 AM)swancollective Wrote: If I call "ObiSoftbody.ResetParticles", nothing happens.

Hi Felix,

ResetParticles() will reset particle positions and orientations (as well as linear/angular velocities) to the values contained in the blueprint, while keeping the softbody transform intact. I just tested with a softbody and it works fine. Keep in mind that it resets particles and particles only -as the name implies- and will not reset the object's transform nor constraints.

You can teleport the softbody to a new position/rotation using softbody.Teleport(pos, rot), which you can combine with ResetParticles(). For example:

Code:
using UnityEngine;
using Obi;

public class ResetActor : MonoBehaviour
{
    public ObiSoftbody softbody;
    public Transform tfrm;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.G))
        {
            softbody.ResetParticles();
            softbody.Teleport(tfrm.position, tfrm.rotation);
        }
    }
}

(23-06-2023, 11:17 AM)swancollective Wrote: Still no success, despite trying for hours with GPT-4's help. No matter what I do, the softbody ignores any attempts to change its position/particles on runtime via script.
PLEASE help <3

Love

Felix

The manual contains an in-depth explanation of how to manipulate any per-particle properties. See:
http://obi.virtualmethodstudio.com/manua...icles.html

Reading an writing particle positions/orientations works fine as far as I can tell, it is just a matter of accessing the solver.positions and solver.orientations array. What have you tried so far? Can you share your code so that we can take a look?

kind regards,
Reply


Messages In This Thread
RESET Obi Softbody - by swancollective - 22-06-2023, 08:25 PM
RE: RESET Obi Softbody - by swancollective - 23-06-2023, 11:17 AM
RE: RESET Obi Softbody - by josemendez - 23-06-2023, 02:19 PM
RE: RESET Obi Softbody - by swancollective - 23-06-2023, 06:00 PM
RE: RESET Obi Softbody - by josemendez - 23-06-2023, 06:42 PM
RE: RESET Obi Softbody - by swancollective - 24-06-2023, 11:52 AM
RE: RESET Obi Softbody - by josemendez - 24-06-2023, 02:48 PM
RE: RESET Obi Softbody - by swancollective - 25-06-2023, 10:15 AM
RE: RESET Obi Softbody - by josemendez - 25-06-2023, 11:06 AM
RE: RESET Obi Softbody - by swancollective - 25-06-2023, 12:39 PM
RE: RESET Obi Softbody - by swancollective - 03-07-2023, 07:20 AM
RE: RESET Obi Softbody - by spikebor - 09-05-2024, 06:12 AM