Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Use obi rope to generate player lines
#4
(11-04-2024, 05:17 PM)Jack Li Wrote: Here is the code about generating the rope and changing the cursor~ Why is the rope not generated for the points in m_Positions? 

What's m_Positions? The code looks like you're trying to generate a rope that passes trough a set of points, but that's precisely what the blueprint is designed for: providing a path that passes trough several control points, and generate a rope out of them. If that's your goal, there isn't any need to loop over m_Positions increasing the length of the rope and manually placing particles yourself. Just create one control point per point in m_Positions.


(11-04-2024, 05:17 PM)Jack Li Wrote: I also want to take a ray starting from the fish and check the number of times the ray passes through the rope to check whether the object is surrounded by the rope, but Query methods don't seem to be able to do it.

No need to use raycast queries for this, there's a much simpler way: just iterate trough all elements in the rope -since they can be considered faces of a polygon- and perform a basic point-in-polygon test like this one: https://wrfranklin.org/Research/Short_Notes/pnpoly.html

About your original issue with the rope jittering, I'm afraid that's unavoidable given your approach: every frame you're removing rope from a different part of it, so the mass distribution at both ends of the rope will change every frame leading to a small jitter. You could increase the solver's sleep threshold slightly, see if that can hide this jitter without affecting rope dynamics too much.

kind regards
Reply


Messages In This Thread
RE: Use obi rope to generate player lines - by josemendez - 15-04-2024, 07:03 PM