Attach an object/node/model to a player

Nekrofage
Member
 
Posts: 35
Joined: Mon Oct 17, 2016 21:12
GitHub: Nekrofage

Attach an object/node/model to a player

by Nekrofage » Sun Dec 25, 2016 16:45

Hi !! :D

I search an example of Lua code to attach an object/node/model to a player.
Do you have links or codes about that ?

Thank in advance!
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

Re: Attach an object/node/model to a player

by stu » Mon Dec 26, 2016 13:15

My wield3d mod has an example of how to do this, if you will excuse the blatant self-promotion. Be warned, however, that object attachment in minetest is rather buggy.
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: Attach an object/node/model to a player

by AiTechEye » Tue Dec 27, 2016 21:38

here are another example:

-- attach object
obj_to_attach:set_attach(on_obj, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})

-- check if attached and detach it
if obj:get_attach() then
obj:set_detach()
end
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

Nekrofage
Member
 
Posts: 35
Joined: Mon Oct 17, 2016 21:12
GitHub: Nekrofage

Re: Attach an object/node/model to a player

by Nekrofage » Fri Feb 03, 2017 21:34

Hi all !! :D

Thank you for your Lua code examples !
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron