Jump to content

Recommended Posts

Posted

hi all now sat disassemble lesson Marble Gamay but I had a problem, I have done everything as a lesson but when you start the climbs here such an error in line 11: self.camera:SetRotation(45,0,0)

function Script:Start()
--создает камеру
self.camera = Camera:Create()
--обновление камеры
self:UpdateCamera()--вызывается функцыя
end
--добвляет камеру поварачивает ее к шару
function Script:UpdateCamera()
-- задает угол для камеры в пространстве
self.camera:SetRotation(45,0,0)[color=#ff0000]<<<<<<<<<<here[/color]
--задает прозицыю отнасительно шара
self.camera:SetPosition(self.entity:GetPosition())
--подымает камеры вверх на 4
self.camera:Move(0,0,-4)
end
function Script:UpdatePhysics()
--изменение в игровом окне (получает)
local window = Window:GetCurrent()
--если нажата кнопка W добавлется сила к обоекту (заставляет его двигаться (засчет физической силы))
if window:KeyDown(Key.W) then self.entity:AddForce(0,0,10,true) end
if window:KeyDown(Key.A) then self.entity:AddForce(-10,0,0,true) end
if window:KeyDown(Key.D) then self.entity:AddForce(10,0,0,true) end
if window:KeyDown(Key.S) then self.entity:AddForce(0,0,-10,true) end
end
function Script:UpdateWorld()
--обновляет камеру каждый фрейм
self.UpdateCamera()
end

Posted

function Script:UpdateWorld()

--обновляет камеру каждый фрейм

self.UpdateCamera()

end

 

should be self:UpdateCamera() not self.UpdateCamera() (colon vs period)

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.

×
×
  • Create New...