![]() |
|
Help Emit rope like silly string - 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 Emit rope like silly string (/thread-4583.html) |
Emit rope like silly string - sacb0y - 06-01-2026 I'm trying to do an effect like silly string emitted from a cannon, I tried using growth speed but that doesn't seem right. How can I get the rope to shoot out from a point? RE: Emit rope like silly string - chenji - 07-01-2026 (06-01-2026, 01:50 PM)sacb0y Wrote: 我想做一个类似用大炮发射彩带的效果,我试过用生长速度,但好像不太对劲。Either add velocity to the end particle, or you can bind the endpoint with a dynamic attachment rigidbody that is very small/transparent, and add velocity to it, if it's easier for you to code. RE: Emit rope like silly string - sacb0y - 08-01-2026 How can I ensure the rope sticks to an animated character, when testing the rope slides when the object is moved or if rigidbody applied the rope sticks properly but slides down. And I'm unable to make it stop sliding down. RE: Emit rope like silly string - chenji - 08-01-2026 (Yesterday, 08:38 AM)sacb0y Wrote: How can I ensure the rope sticks to an animated character, when testing the rope slides when the object is moved or if rigidbody applied the rope sticks properly but slides down. And I'm unable to make it stop sliding down.What do you mean by "slides down” ? Pls show a pic or video. RE: Emit rope like silly string - josemendez - 08-01-2026 (Yesterday, 08:38 AM)sacb0y Wrote: How can I ensure the rope sticks to an animated character, when testing the rope slides when the object is moved or if rigidbody applied the rope sticks properly but slides down. And I'm unable to make it stop sliding down. Hi, What do you mean "stick to"? attaching the rope to the character? or have high friction? or adhere to the surface...? all of these things are accomplished in different ways. Could you be more specific? RE: Emit rope like silly string - sacb0y - 08-01-2026 Where's two clips. Both have "Very sticky" as a collision material This is "kinematic to particles" which acts the same as with rigid body off, where if the object is still it's fine, but moving it around is strange. ![]() This is with a rigid body on the sphere, this sticks to the mesh properly even if it moves but it also slides off. ![]() What I want is the behavior of the first image, but it stays mostly in place when i move the object rather than slide around. I expect some movement but not like that. RE: Emit rope like silly string - josemendez - 08-01-2026 (Yesterday, 07:35 PM)sacb0y Wrote: Where's two clips. Both have "Very sticky" as a collision material Here you’re not “moving the rigidbody”: you’re setting the transform position. These are two entirely different things. Rule #1 of rigidbodies is do not set their transform values directly during simulation. When you use the transform gizmos in any 3D software, what they do is “teleport” the object to a new position: they do not apply a force/acceleration/change in velocity to the object using the physics engine (the rigidbody in Unity’s case) so it stands to reason that physics of any kind are entirely ignored when doing this: you will be able to move objects trough walls, move platforms without objects on top staying on them, etc. Little experiment you can do in Unity: put a box rigidbody on top of a floor, give either of them a material with high friction. Then slide the floor underneath the box to one side: you’d expect the box to move together with the floor due to friction, but it won’t move at all since the floor has *zero velocity*: it’s being teleported around. This is simply how simulated physics works. (Yesterday, 07:35 PM)sacb0y Wrote: This is with a rigid body on the sphere, this sticks to the mesh properly even if it moves but it also slides off. It’s not really possible to do this using physics. The reason is that adhesion and friction are forces, hence affected by mass: for the rope to stick perfectly to a rigidbody the rigidbody must have *infinite* mass, that is, be kinematic. For a non-kinematic rigidbody, you can increase its mass w.r.t. the rope and the larger the mass ratio (that is, the heavier the rigidbody is conpared to the rope) the better the rope will adhere to it, but unless the ratio is infinite adhesion won’t be perfect. I guess what you’re looking for is just some kind of static parenting? You can do this using contact callbacks to detect when particles touch the sphere rigidbody, then just storing their contact position and moving them there every frame. Kind regards, RE: Emit rope like silly string - sacb0y - 09-01-2026 Okay I see, so my testing is wrong, I'll try in a bit more of a gameplay scenario. So if this is on a character as long as the character is moved by physics and animation it should work? What is the recommended setup for an animated character if this is the case? I'll look into the mass thing ? I'm fine if it's not perfect. But are there any code examples to the parenting? I tried something like this with splines but it was rather slow. RE: Emit rope like silly string - josemendez - 09-01-2026 (9 hours ago)sacb0y Wrote: Okay I see, so my testing is wrong, I'll try in a bit more of a gameplay scenario. It's not just the testing that's wrong, this is more of a basic misconception: transforms are simply positions/orientations in space, no physics involved in them (no second order effects, no velocity, inertia, or anything like that) so anything that drives transform data directly (like animation) won't work with physics at all. It's one of the reasons why you often see character limbs clip trough walls in games. This applies no matter which physics engine you're using or in what context the transform manipulation takes place (using gizmos in the scene view, using custom scripts, using animation, etc). For physics consistency you need to drive rigidbody velocity, either by applying forces, accelerations, or impulses. (9 hours ago)sacb0y Wrote: So if this is on a character as long as the character is moved by physics and animation it should work? I'm assuming by animation you mean skeletal animation, as in the typical humanoid character setup: a capsule for collision detection and a skinned mesh renderer for skeletal animation. In that case, it won't work: as mentioned before, manipulating transform values directly has zero regards for physics (which is what animation does: it simply sets joint position/orientation every frame). Unless your character is 100% physics based (eg. active ragdoll) then you can't use physics for this. (9 hours ago)sacb0y Wrote: What is the recommended setup for an animated character if this is the case? There's no single approach for characters. It very much depends on how your character needs to work and how you've decided it should interact with user input, the world around it, etc. For instance, if your character controller is fully kinematic then you'd bypass physics entirely and do this kinematically as well. If your character controller is physics based but you're using skeletal animation to drive its joints, then you'd use linear blend skinning to dynamically "skin" points (be it rope particles, spline control points or whatever your strings are made of) to the joint hierarchy. Only in case both your character controller and your joint hierarchy are fully physics driven you can use physics for this. Note this is not the typical use case you'd face with characters, which is a rope-like object statically attached to an animated character (eg a belt, a braid, a tail, etc). There, points in the rope are kinematically attached to the character and they start and stay attached to it. That case is a lot simpler and Obi has its own dedicated component for it: ObiParticleAttachment. Yours is a *very* advanced use case and requires deep understanding of how physics works, how animation works, how character controllers work (both kinematic and physics-based, as they have different tradeoffs) and how they all fit together in various scenarios. (9 hours ago)sacb0y Wrote: I'm fine if it's not perfect. But are there any code examples to the parenting? I tried something like this with splines but it was rather slow. For this to be performant you must use multithreading. Iterating trough a bazillion particles every frame in the main thread using C# is bound to be slow no matter the kind of primitive (spline control points, rope particles, transforms, rigidbodies) you use. The manual contains explanation and sample snippets for collision callbacks as well as particle manipulation, most using single-threaded code for clarity. let me know if you need further help, kind regards |