[LUA Scripting Issue] Model position coordination bug.
2 replies, posted
Hello there! Recently I've been having this strange bug with Scripted Entities, the model of the entity twitches between starting position and actual position. The fun fact is: That when the model twitches to the original position, it cannot be touched.
It's difficult to explain so have a video:
[video=youtube;xty_Ydyy1XA]https://www.youtube.com/watch?v=xty_Ydyy1XA&feature=youtu.be[/video]
You are setting the move-type, solidity and physics init on the server AND client, make sure it only set serverside.
An easy fix is to wrap it with:
[lua]
if SERVER then
--your code
end
[/lua]
example:
[lua]
function ENT:Initialize()
if SERVER then
self:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
end
end
[/lua]
[QUOTE=Th13teen;49500324]You are setting the move-type, solidity and physics init on the server AND client, make sure it only set serverside.
An easy fix is to wrap it with:
[lua]
if SERVER then
--your code
end
[/lua]
example:
[lua]
function ENT:Initialize()
if SERVER then
self:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
end
end
[/lua][/QUOTE]
Thank you. I was guessing something similar, but didn't know exactly what.
Sorry, you need to Log In to post a reply to this thread.