Slastraf Posted September 19, 2015 Posted September 19, 2015 Script.entity2 = nil --entity "allignto" function Script:Start() self.camera=Camera:Create() self.camera:SetFOV(90) self.camera:SetRange(0.05,1000) self.camera:SetMultisampleMode((System:GetProperty("multisample","1"))) self.camera:SetMass(0) self.entity:SetMass(0) end function Script:UpdateWorld() self.camera:AlignToVector(self.entity2:GetPosition()) self.camera:SetPosition(self.entity:GetPosition()) end I have no Idea on how to use the AllignToVector method, the only thing happens is that the camera is not pointing at the entitys position. How can i fix this ? Quote
Jazz Posted September 19, 2015 Posted September 19, 2015 maybe this? self.vector = self.entity:GetPosition(true) - self.entity2:GetPosition(true) self.camera:AlignToVector(self.vector:Normalize(),2) Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060
Slastraf Posted September 20, 2015 Author Posted September 20, 2015 maybe this? self.vector = self.entity:GetPosition(true) - self.entity2:GetPosition(true) self.camera:AlignToVector(self.vector:Normalize(),2) experimented a bit and figured out it was the other way around self.vector = self.entity2:GetPosition(true)-self.entity:GetPosition(true) self.camera:AlignToVector(self.vector:Normalize(),2) 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.