Jump to content

Recommended Posts

Posted

I have a fairly complex object that can be picked up, so to avoid frustration getting the mouse in the right spot, I want to use my collision object for the Pick().

 

Can this be done?

Posted

One way I can think of doing this is giving all of your collision objects a unique mass like 2.2. Then the script would look like this-

if mass==2.2 then

self.carryingEntity=pickinfo.entity

elseif mass>0 and mass<=self.carryweight etc.

That would make any object with a mass of 2.2 usable though so be careful with that method...it can get kind of messy.

 

edit--im tired and my previous suggestion actually doesn't make that much sense. I am guessing that your collision objects have a mass of 0 and that is why they are unusable? or are they hidden?

If they have a mass of 0 you could give them a script with something like Script.object=true then change your fpsplayer script to check for it like--

if pickinfo.entity.script then

if pickinfo.entity.script.object==true then

self.carryingEntity=pickinfo.entity

end

end

local mass=pickinfo.entity:GetMass() ..etc

 

if your object isn't to complex just do what rick suggested below.

Check out my game Rogue Snowboarding- 

https://haydenmango.itch.io/roguesnowboarding

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.

×
×
  • Create New...