blenderNetworkpatreonblender-logosdheartuserthtimesbookphotopencilmap-markerchevron-rightbancommentcommentstwitterfacebookrsschainnavicongoogle-plusenvelopelinkedinmail-replycalendar-otumblrredditstumbleuponshare-altbloggerflattrflag

Item pickup

Item pickup

Postby tobimai » October 18th, 2014, 8:18 am

Hello
I have a little Question, how can I do that my character picks up items(item should disappear). I tried That tutorial https://www.youtube.com/watch?v=yDbT3gPdyWc but it doesn't work. If I go near the item nothing happens :(
Maybe someone could help me.
Thanks!
tobimai
Newbie
Newbie
 
Posts: 9
Joined: October 6th, 2014, 12:37 pm

Re: Item pickup

Postby djm » October 18th, 2014, 2:29 pm

It's actually very easy to set up.
first of all you make sure you have collision set to both the pick-up and the character (you can use actor too and use the near sensor, but it is less reliable).

So when that is done you simple click on the character, create a property "player" and another property called "pickup", then click on the pick-up item and set the logic bricks as following..

[Collision 'property': player] -> and -> [message to player/character with 'topic'] and also connect the 'and' to a [edit object 'end object'] actuator.

After this you go to the character/player and add a [message sensor with 'topic'] -> and -> [property "pickup" 'add' 'value (5 for example)'].

So when this is done the pickup item will disappear and add a value off 5 to your pickup property. Then what you decide to do with the property itself is up to you. It can be ammo, health, EXP etc. No limits really.

Good luck and have fun!
Regards, DJM aka Sheldin!

DeviantArt Profile
http://sheldiner.deviantart.com/

Youtube (Tutorials/Gaming)
http://www.youtube.com/SheldinLP
User avatar
djm
Pro
Pro
 
Posts: 478
Joined: December 11th, 2009, 4:04 pm
Location: Sweden

Re: Item pickup

Postby tobimai » October 19th, 2014, 10:44 am

It worked! Thank you :D
tobimai
Newbie
Newbie
 
Posts: 9
Joined: October 6th, 2014, 12:37 pm

Re: Item pickup

Postby djm » October 19th, 2014, 12:51 pm

No problem! Glad i could help! :D
Regards, DJM aka Sheldin!

DeviantArt Profile
http://sheldiner.deviantart.com/

Youtube (Tutorials/Gaming)
http://www.youtube.com/SheldinLP
User avatar
djm
Pro
Pro
 
Posts: 478
Joined: December 11th, 2009, 4:04 pm
Location: Sweden
Return to Blender Game Engine

Who is online

Users browsing this forum: No registered users and 1 guest

cron