Currently I am writing a script that can spawn an object then strech it sideways.
I found out about using VMatrix but I can't get it working.
[code]
local ent = ents.Create( "prop_dynamic" )
if ( IsValid( ent ) ) then
ent:SetModel( "models/manatails/lms/cube.mdl" )
ent:SetPos( vPoint )
ent:SetMaterial("Models/props_combine/portalball001_sheet")
ent:DrawShadow(false)
ent:SetNotSolid(false)
ent:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)
ent:Spawn()
local scale = Vector( 10, 10, 1 )
local mat = Matrix()
mat:Scale( scale )
ent:EnableMatrix( "RenderMultiply", mat )
end
[/code]
When I run the code I get the error 'attempt to call method 'EnableMatrix' (a nil value)'
thinking that the object type is the problem I tried using other types of props like prop_physics but I get the same result.
Any comments on what is happening here?
[editline]17th June 2017[/editline]
nevermind, just saw on the wiki page that the function is clientside only.
If only you'd bothered to look at the wiki page for EnableMatrix, you'd know that it's a clientside only function, and you are trying to use it on the server side.
[url]http://wiki.garrysmod.com/page/Entity/EnableMatrix[/url]
Sorry, you need to Log In to post a reply to this thread.