Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Particle Attachment has weird offset
#1
Hi,

I'm trying to make a simple fishing line that's attached to the bobber and the tip of the rod (just a mesh, not using obi rod).

I'm instantiating a bobber prefab which hierachy is like so:
-Bobber
  - Obi Solver
    - Obi Rope

On the Obi Rope path I have two control points named bobber and tip. On the Obi Rope gameobject I have two Obi Particle Attachments, they're both dynamic. One of them has the parent Bobber as target and the other is null. I also have an Obi Cursor and Obi Reel scripts.

When the player fishes, I call a method that instantiates the Bobber prefab, sets the other obi attachment target to the rod tip transform and then plays a fishing animation.

The rope gets attached to the bobber just fine, but the rod tip has a weird offset to it. It's still attached to it so if I move the tip in the editor it moves with it but with an offset.

How do I fix this?
[Image: obiproblem.jpg]
Reply
#2
Is the tip of the rope exactly on top of the tip of the rod, at the time of being attached?

Attachments attach particles at their current position relative to the target. Otherwise they'd "jump" to the target and a lot of kinetic energy would be added to the rope resulting in unwanted motion. If you just instantiate the rope and attach it to the rod, it will remain attached at whatever position it was instantiated in.

Simply position the rope properly before attaching it.
Reply
#3
(28-07-2021, 11:12 AM)josemendez Wrote: Is the tip of the rope exactly on top of the tip of the rod, at the time of being attached?

Attachments attach particles at their current position relative to the target. Otherwise they'd "jump" to the target and a lot of kinetic energy would be added to the rope resulting in unwanted motion. If you just instantiate the rope and attach it to the rod, it will remain attached at whatever position it was instantiated in.

Simply position the rope properly before attaching it.
I see, thank you! I was able to fix it by making my rope as short as possible in the prefab and then placing it on top of the tip at instantiation.
Reply