Jump to content

Entity Properties on Collision


jefftrier
 Share

Recommended Posts

Hi all,

 

First I would like to say that it's nice meeting this community. I have been playing around with this engine for a few days (random tutorials, prototypes, etc), and I have to say I am very excited about it!

 

Now on to the question! smile.png

 

I want to create a pick-up object that disappears when the player walks into it (ammo/health/etc). I know there has to be a basic tutorial on this, but I am having no luck locating one.

 

What I would like to do, is make this call in the Collision function in FPSPlayer.lua. From my understanding, tname should give me the entity name... but none is returned (rather I get 0x00000000, which I imagine in null).

 

function Script:Collision(entity,position,normal,speed)
if speed>20 then
self:Hurt(100)
end

tname = entity:GetKeyValue("name")
System:Print(tname)

end

 

Can someone point me in the right direction? smile.png

 

Thanks!

-Jeff

SH_Banner_467x83.jpg
Link to comment
Share on other sites

That did the trick!

 

Hey, you know... I have to say that this tutorial was FAR more useful than was titled. I think it's perfect for beginners (like me ^.- ) to get started from scratch, and to learn the base mechanics relatively quickly. It may deserve a retitling to "Leadwerks for Newbies", or some-such. :)

 

Great job on that tutorial!

 

-Jeff

SH_Banner_467x83.jpg
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...