Slastraf Posted May 30, 2016 Share Posted May 30, 2016 if window:MouseHit(1) then local pickinfo= PickInfo() local p1 = Window:GetCurrent():GetMousePosition() --local box = Model:Box() if (self.camera:Pick(p1.x,p1.y,pickinfo,0.5,true)) then if pickinfo.entity then if pickinfo.entity:GetKeyValue("Button")~="" then --box:SetScale(0.2,0.2,0.2) --box:SetPosition(pickinfo.entity:GetPosition(true),true) System:Print(tostring(pickinfo.entity:GetKeyValue("Button"))) end end end end the above is the camera pick , I cant find anything . The camera pick should Print the Key value of the box in the script below. However, it prints nothing and I dont know why. Script.localKeyValue = -1--string " Key Value Integer" function Script:Start() self.entity:SetKeyValue("Button",self.localKeyValue) end Quote Link to comment Share on other sites More sharing options...
macklebee Posted May 30, 2016 Share Posted May 30, 2016 Works ok for me. Prints out -1. Granted I wouldn't use a pick with a radius as its not a precise pick, but it works in my test of the scripts. Keep in mind, you are setting the pick radius to be 0.5 meters. My suggestion would be to use System:Print()'s in your multiple if-statements to find where it is failing to get to the Print you want to see and to not use spherical picks, especially on small objects. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel 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.