![]() |
Remove Initial Target Offset: Attachments - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Remove Initial Target Offset: Attachments (/thread-3839.html) |
Remove Initial Target Offset: Attachments - Renman3000 - 13-04-2023 Hi, I have a single rope and two Particle Attachments. My issue is that if the Transforms of the Target, for the ObiParticleAttachment are not at the exact position of the ends of the rope, then obi rope does not update to the target position, but the target position + that initial offset. Can I snap the rope particle group, attachment position to the target position, in other words, remove the offset? Thank you RE: Remove Initial Target Offset: Attachments - josemendez - 14-04-2023 (13-04-2023, 04:19 PM)Renman3000 Wrote: Hi,Hi! This is the intended behavior, as explained in the manual: http://obi.virtualmethodstudio.com/manual/6.3/attachments.html Quote:It's important to realize that attachments do not move the particle group to the position of the target object, nor the target object to the position of the particle group. Moving the particle group to the target's position would collapse all particles into a single point, and would result in a kickback effect once the particles spring back to their original positions. Moving the target could cause a whole palette of issues depending on your game logic. If you want to remove the offset, you have to either: A) move the target transform to the attachment position. B) move the attached particle to the target transform's position. Or any combination of both (move both the attached particle and the transform to their average position, for instance). Afterwards, create the attachment. You can get/set individual particle positions using the particles API, and you can retrieve the index of the particles involved in the attachment by reading the "indices" array of the particle group (In the case of a rope, there's always only one particle per particle group). kind regards, RE: Remove Initial Target Offset: Attachments - Renman3000 - 17-04-2023 (14-04-2023, 07:50 AM)josemendez Wrote: Hi! ok, thank you. - my aim tho, just so you know is to use a number of standard prefabs whose varitions (in posisitions) could be set at runtime. Under this I must set by hand each. Could the system not pause to adjust before any particle firing occurs? Anyhow, thank you for your help. RE: Remove Initial Target Offset: Attachments - josemendez - 17-04-2023 (17-04-2023, 01:19 PM)Renman3000 Wrote: Could the system not pause to adjust before any particle firing occurs? Do you mean you want to create a rope that goes from point A to point B, both chosen at runtime? you can do that too, by creating the rope blueprint at runtime. See: http://obi.virtualmethodstudio.com/manual/6.3/scriptingactors.html kind regards, |