Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi 7.0 ParticleAPI
#8
(10-06-2025, 08:31 AM)alicecatalano Wrote:
                int solverIndex = rope.solverIndices[i];
                Vector3 particlePos = rope.solver.positions[solverIndex]; // GetParticlePosition(solverIndex);
                Debug.Log($"particle {solverIndex} position {particlePos}");
           
1. You get the wrong particle (though it may work in your case sometimes, your code is actually an unstable way, or a wrong way). See https://obi.virtualmethodstudio.com/manu...ropes.html. You must use something like this to get particle position:
int firstParticle = rope.elements[0].particle1;
var firstPos = rope.solver.positions[firstParticle];

2. You get the wrong position. You're getting the local position. If you need world position you must transform local to world.
Reply


Messages In This Thread
Obi 7.0 ParticleAPI - by PlatonSk - 29-08-2024, 11:37 AM
RE: Obi 7.0 ParticleAPI - by goosejordan - 29-08-2024, 12:01 PM
RE: Obi 7.0 ParticleAPI - by josemendez - 29-08-2024, 12:02 PM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 09-06-2025, 04:33 PM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 06:23 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 10-06-2025, 08:31 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 08:47 AM
RE: Obi 7.0 ParticleAPI - by chenji - 10-06-2025, 09:40 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:16 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 10-06-2025, 10:18 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:26 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 12-06-2025, 09:19 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:21 AM