swipis Posted April 11, 2016 Share Posted April 11, 2016 Hello! I have some problem, here is the code Script.camPivot = "" --entity "Pivot" Script.mx = 0 Script.my = 0 Script.prevmx =0 Script.prevmy = 0 Script.toggle = 0 Script.window = Window:GetCurrent() function Script:UpdateWorld() if window:MouseHit(Key.RButton) then toggle = 1 end if window:MouseDown(Key.RButton) then mousePos = window:GetMousePosition() mx = self.camPivot.GetRotation().x + (mousePos.y - prevmy) my = self.camPivot.GetRotation().y + (mousePos.x - prevmx) if toggle == 1 then toggle = 0 mx = self.camPivot.GetRotation().x my = self.camPivot.GetRotation().y end self.camPivot:SetRotation(mx, my, self.camPivot:GetRotation().z) prevmx = mousePos.x prevmy = mousePos.y end end when I start game and press mouse button I getting error message: error in function 'GetRotation', argument #1 is [no object; Entity expected]. here is how looks scene: what is wrong here? Thank you Quote Link to comment Share on other sites More sharing options...
macklebee Posted April 11, 2016 Share Posted April 11, 2016 self.camPivot.GetRotation() should be: self.camPivot:GetRotation() colon not period... 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...
swipis Posted April 11, 2016 Author Share Posted April 11, 2016 thanks 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.