23-06-2023, 02:19 PM
(This post was last modified: 23-06-2023, 04:03 PM by josemendez.)
(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,