Slastraf Posted March 31, 2016 Posted March 31, 2016 I have a third person character controller, the character has pickmode(0). I can walk around and have obstacles between the player and the cam , but nothing happens? the self.pivot is a pivot which is at the center of the character (the camera focus). updateworld: if self.entity.world:Pick(self.pivot:GetPosition(),self.camera:GetPosition(),pickinfo,0,true) then local model2 = Model:Box() model2:SetPickMode(0) model2:SetPosition(pickinfo.position) model2:SetColor(0,1,0) System:Print(">> PICKED") --self.camera:SetPosition(pickinfo.position) end Quote
thehankinator Posted March 31, 2016 Posted March 31, 2016 When I did this for one of my games I used Collision.LineOfSight in the Pick() and set all the environment to Scene. Also, I would pass true to both GetPosition() calls, if they don't share the same parent they could be in different coordinate space. 1 Quote
martyj Posted March 31, 2016 Posted March 31, 2016 You could try picking from the camera on screen ordinates. Depending on the location of the pivot whether it is behind the camera or in front, decides where it picks. http://www.leadwerks.com/werkspace/page/api-reference/_/camera/camerapick-r199 Quote
Slastraf Posted March 31, 2016 Author Posted March 31, 2016 When i get the global position with GetPosition(true) , it works fine. Same as my last problem ._. When I did this for one of my games I used Collision.LineOfSight in the Pick() and set all the environment to Scene. Also, I would pass true to both GetPosition() calls, if they don't share the same parent they could be in different coordinate space. Quote
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.