Derma Model Viewer Question


 
local window = vgui.Create( "DFrame" )
window:SetSize( 200,200 )
window:Center()
window:SetTitle( "DModelPanel Test" )
window:MakePopup()
 
local icon = vgui.Create( "DModelPanel", window )
icon:SetModel( LocalPlayer():GetModel() )
 
icon:SetSize( 100, 100 )
icon:SetCamPos( Vector( 50, 50, 120 ) )
icon:SetLookAt( Vector( 0, 0, 0 ) )


I got this code, I want the head to look at the mouse pos.
Anyone got any help?
Greatly apperacited. <3

I assume you’re trying to copy that?

Yep.

You could have the SetLookAt follow the mouse using:

[lua]
gui.ScreenToVector( gui.MousePos() );
[/lua]

[tab]Edit:[/tab]

You can also use Entity.SetPoseParameter to do so.

That won’t work.