Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope saving and restore by Json
#2
If I do not check whether "i < particlesIndices.Length", then the following code "solver.positions[particlesIndices[i]]" will cause an out-of-bounds error. The number of actor.solverIndices is often much smaller than the number of particles read from the JSON. I believe this may be because, when instantiating the rope, the initial path only sets the start and end point.

If I add "Time.timeScale = 0;" after calling  Actor_OnBlueprintLoaded(), the ropes freeze, and the shape appears consistent with how it was before saving. However, there are some branches and disarray.

If I enable particle debugging and hide the rope's model, you can see that the shape formed by the particles is correct. However, there are gaps in the areas marked with red circles, which look like some particles are missing. I suspect this is the possible reason why the ropes do not remain intertwined under the influence of physics.

Once the freeze is lifted, the rope's state immediately reverts to a scattered state, exactly the same as in the previous screenshots.

I even tried to increase the particle count array of the blueprint based on the number of particles in the JSON after the blueprint generation was completed, but it still didn't work.

I have been stuck here for a long time and have tried many methods. Have I missed something? Or is there a better and more efficient way to generate a rope with a specific shape at runtime based on the data?

Please help me, I would be extremely grateful!
Reply


Messages In This Thread
Rope saving and restore by Json - by tapLucas - 22-06-2024, 03:32 PM
RE: Rope saving and restore by Json - by tapLucas - 22-06-2024, 06:37 PM
RE: Rope saving and restore by Json - by tapLucas - 25-06-2024, 09:02 AM
RE: Rope saving and restore by Json - by tapLucas - 25-06-2024, 09:31 AM
RE: Rope saving and restore by Json - by tapLucas - 25-06-2024, 09:55 AM
RE: Rope saving and restore by Json - by tapLucas - 25-06-2024, 10:26 AM
RE: Rope saving and restore by Json - by tapLucas - 27-06-2024, 11:54 AM
RE: Rope saving and restore by Json - by tapLucas - 27-06-2024, 12:59 PM
RE: Rope saving and restore by Json - by tapLucas - 11-07-2024, 07:21 AM
RE: Rope saving and restore by Json - by tapLucas - 17-08-2024, 09:02 AM
RE: Rope saving and restore by Json - by tapLucas - 17-08-2024, 10:37 AM
RE: Rope saving and restore by Json - by tapLucas - 17-08-2024, 11:10 AM