First Hello all,
I need because i make a 2D gamemode on gmod and i need to set the camera on a prop but everithing work well but when i go on my desktop and go back on gmod my screen is black.
here my lua :
[code]
function meta:SetupCamera()
if self.Camera then return end
local cam = ents.Create( "prop_physics" )
cam:SetModel( "models/player.mdl" )
cam:SetPos( self:GetPos() + Vector( 0, 0, 64 ) )
cam:SetColor( 255, 255, 255, 0 )
cam:DrawShadow( false )
cam:SetAngles( Angle( 65, 0, 0 ) )
cam:Spawn()
cam:Activate()
cam:SetSolid( SOLID_NONE )
cam:SetMoveType( MOVETYPE_NONE )
cam:SetCollisionGroup( COLLISION_GROUP_DEBRIS_TRIGGER )
self:SetViewEntity( cam )
self.Camera = cam
self:PrintMessage( 3, "SetupCamera CAMERA = " .. tostring(self.Camera))
end
[/code]
the output : CHECK CAMERA = Entity [149][prop_physics]
try
"CheckCamera" =
seeing how the hook has already defined CheckCamera
Not working ..
GM:CalcView would be an alternative.
Sorry, you need to Log In to post a reply to this thread.