[SOLVED] Swinging Rope Mechanic

Hello Folks, we are having an issue concerning using a physics based ladder.

We have a chain (with individual links welded through the physics actions) that the player should be able to grab a hold of and swing himself left to right. However, we are unable to make this happen and we tried different scenarios. The issues are as follows:

-The chain does not follow the player nor the player the chain when collision is disabled on the physics layer\mask

-If the player and the chain are on the same layer\mask they collide and it creates issues

-Using a parent\child relationship creates unwanted effects or nothing at all in some cases

Would love to hear what you guys think about this and if you have any suggestions.

1 Like

I’d look at keeping different physics collision masks and collision layers for the player and chain (to avoid the issues you mention), and use the normal collision check to determine if the player is in touch with the chain.

Make use of a hidden object that’s smaller than, and stuck to, the player. Upon collision with this hidden object and the chain, create a joint between the player and chain.

1 Like

We have attempted to try out your suggestion. Unfortunately it seems that the chain will flail aimlessly while the character is unaffected. No matter what, he refuses to remain welded on the chain. I don’t suppose there is a draft somewhere of something similar we could observe and perhaps try to understand where the issue lies?

We’ve tried messing with the physics status of the character by switching to kinematic and dynamic, altered the density of the chain to make it heavier and other elements of the join itself. We even experimented with different types of joints such as ‘‘Weld’’ and ‘‘Distance’’. Any further insight would be appriciated.

EDIT: We’ve figured out the issue and are now faced with the problem of removing the joint after we decided to jump from the chain. However we are unable to understand the concept of ‘‘JointID’’ or how to identify it in order to remove it.

When you create a joint, there’s an optional parameter for a variable to take the joint id (the bottom parameter in the action editor panel). You supply the variable name, and the action will fill it with the Id. It’s a unique identifier generated when the joint is created. You’ll need to use this when you remove the joint.

1 Like

We were able to figure out how to accomplish our task of resolving the above issue. We are marking this post as SOLVED. Below is a crude example in .GIF form along with pictures from the event window for anyone who would seek awnsers to such issues. We feel welcomed by this community and would like to give back by posting our foundation to the resolution of the problem to help out future developers who seek knowledge.

A special thanks to user MrMen, whose insight, advice and willingness to help had a huge impact on our success to deal with the meantioned obstacle.

Best Regards,
W&A Interactive


ChainTest2

3 Likes