![]() |
|
Help Spawn obi rope with scripted transform and attachment - 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: Help Spawn obi rope with scripted transform and attachment (/thread-4611.html) |
Spawn obi rope with scripted transform and attachment - anxis - 17-04-2026 Hi, I'm making a game based on the same core idea as Chained Together. I spawn my players at runtime, and with that in mind, I also spawn a prefab that contains a solver and a rope. Then I attach the start of the rope to Player 1 and the end to Player 2. This part works well the rope is correctly attach but its placement is completely off. So I'm wondering do I need to change the way I manage this system, or is there a way to adjust the rope path via scripting? RE: Spawn obi rope with scripted transform and attachment - josemendez - 17-04-2026 (17-04-2026, 04:32 AM)anxis Wrote: Hi, I'm making a game based on the same core idea as Chained Together. I spawn my players at runtime, and with that in mind, I also spawn a prefab that contains a solver and a rope. Then I attach the start of the rope to Player 1 and the end to Player 2. Attachments attach the rope at whatever its current position is, relative to the object it's being attached to. They won't automatically change the length/shape of the rope to reach the attachment point or anything like that. So if Player1 and Player 2 may be at different positions everytime they spawn, spawning a rope prefab won't work at all since the rope is always the same one. You must instead create a new rope that goes from Player1.position to Player2.position. See "scripting actors" in the manual for code that creates a solver, blueprint and rope entirely trough code: https://obi.virtualmethodstudio.com/manual/7.1/scriptingactors.html let me know if you need further help. kind regards |