Jump to content

[SOLVED]help with lua needed


swipis
 Share

Recommended Posts

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:

13HwcAd.png

 

what is wrong here?

Thank you

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...