Jump to content
Doggifast

Object attaching to humans

Recommended Posts

What i need: an object (like a rugged case) following a human spine like it's a backpack.
What i have:

//On start i attach the object to the human with [box, man] call BIS_fnc_AttachToRelative;
//Then i use the following code for the object to follow the vectors of the spine:
[] spawn {
while {alive man} do {
box setVectorDirAndUp (man selectionVectorDirAndUp ["spine1", "HitPoints"]);
};
};

It follows the vectors, but when i look down or up, it still clips into the body, since it's still relatively attached and not to the person itself. Please help
I can post a video on how i made it if more explanation is needed

Share this post


Link to post
Share on other sites

Try to play with numbers in this code:

box attachTo [man, [-0.1,-0.13,+0.1], "pelvis", true];

See attachTo main syntax.

Share this post


Link to post
Share on other sites
Just now, Ibragim A said:

Try to play with numbers in this code:


box attachTo [man, [-0.1,-0.13,+0.1], "pelvis", true];

 

this code only attaches the box to the man. the box remains static, it doesn't follow the rotation of the spine. the code that i attached does,.. but it doesn't update it's position relative to the spine. it basically still floats there attached, now only following the rotation
basically i want it to act like a backpack without stealing BI assets and adding the backpack into the game
I'm looking to make it like a carrying system (maybe like in Payday 2?) where you can literally steal a thing and put it on your back or anywhere else

Share this post


Link to post
Share on other sites
1 minute ago, Ibragim A said:

See attachTo main syntax followBoneRotation argument and set it to true.

Hm. Maybe i missed something and overthinking this. Give me a minute

Share this post


Link to post
Share on other sites

I attached a Rugged Portable Lamp (Land_PortableLight_02_folded_sand_F):

box1 attachTo [man1, [0,-0.25,0], "spine3", true];

Use "spine3."

 

That particular type of object works well in this situation, other types of objects will probably require a setVectorDirAndUp. See example 4 on the attachTo page.

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Harzach said:

I attached a Rugged Portable Lamp (Land_PortableLight_02_folded_sand_F):


box1 attachTo [man1, [0,-0.25,0], "spine3", true];

Use "spine3"

It works, jesus it was so easy. Thank you so much

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×