Slastraf Posted September 19, 2015 Share 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 Link to comment Share on other sites More sharing options...
Jazz Posted September 19, 2015 Share 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 Link to comment Share on other sites More sharing options...
Slastraf Posted September 20, 2015 Author Share 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 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.