Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  procedure control point does not spawn particle in correct place
#1
I'm making something like a grappling hook, but I need to respawn the line each time it's triggered. To do this I modified some code from the obi grappling hook example where the blueprint is regenerated and I set the control points. However, the particles don't seem to spawn in the correct location. Here is the code to spawn the particles:

```
        var localPos = rope.solver.transform.InverseTransformPoint(transform.position);
        var characterLocalPos = rope.solver.transform.InverseTransformPoint(character.transform.position);

        rope.ropeBlueprint = null;

        var filter = ObiUtils.MakeFilter(0x0000FFFE, 0);
        blueprint.path.Clear();
        blueprint.path.AddControlPoint(characterLocalPos, Vector3.zero, Vector3.zero, Vector3.up, 1f, 0.1f, 1, filter, Color.white, "Start");
        blueprint.path.AddControlPoint(localPos, Vector3.zero, Vector3.zero, Vector3.up, 1f, 0.1f, 1, filter, Color.white, "End");
        blueprint.path.FlushEvents();
        yield return blueprint.Generate();

        rope.ropeBlueprint = blueprint;
```

But the first and last particles are noticebly off by the same amount whereas I would expect them to be located exactly at the transform positions specified in the blueprint. Am I doing something wrong here?
Reply


Messages In This Thread
procedure control point does not spawn particle in correct place - by bugbeeb - 29-07-2024, 03:21 AM