Nope weapons will have to be dynamic.
The camera have "freelook" script, i just added weapons management in it for the moment.
The launcher is loaded by code, and declared as globam variable.
function Script:Start()
launcher = Model:Load("Models/Characters/test/launcher.mdl")
Then it is rotated as camera is rotated
function Script:UpdatePhysics()
...
...
camerarotation.x = camerarotation.x+self.mousespeed.y*self.lookspeed
camerarotation.y = camerarotation.y+self.mousespeed.x*self.lookspeed
self.entity:SetRotation(camerarotation)
launcher:SetRotation(camerarotation)
Finally i tried to move it in front of camera : but compilation fails
function Script:Render()
self.entity:SetPosition(self.pivot:GetPosition(true),true)
deltaPosx = self.pivot.x
deltaPosy = self.pivot.y
deltaPosz = self.pivot.z
launcher:SetPosition(deltaPosx,deltaPosx,deltaPosx )
end
I guess, it's another maths that are needed to place some object in front of camera like using the normal vector of camera direction.