Brutile Posted May 29, 2014 Share Posted May 29, 2014 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? Quote Link to comment Share on other sites More sharing options...
Haydenmango Posted May 29, 2014 Share Posted May 29, 2014 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. Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Rick Posted May 29, 2014 Share Posted May 29, 2014 Throw a csg box around it and paint the invisible material on the box and make it the parent of the actual mesh. Quote Link to comment Share on other sites More sharing options...
Brutile Posted May 29, 2014 Author Share Posted May 29, 2014 Thanks for the suggestions. I'll try them out when I get a chance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.