• ENT:Touch being called twice
    6 replies, posted
[CODE]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") util.AddNetworkString( "red_score" ) function ENT:Initialize() self:SetModel("models/props_phx/misc/soccerball.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) self:SetModelScale( self:GetModelScale() * 5, 1 ) self:SetGravity(10) local d=99 local r=d/2 self:PhysicsInitSphere(r) local phys = self:GetPhysicsObject() phys:SetMass(5) phys:Wake() end function ENT:Touch(e) self:Remove() print("Hi") end[/CODE] "Hi" is being printed twice.
Updated the wiki page for you: [url]http://wiki.garrysmod.com/page/ENTITY/Touch[/url]
[QUOTE=Robotboy655;52567780]Updated the wiki page for you: [url]http://wiki.garrysmod.com/page/ENTITY/Touch[/url][/QUOTE] Thank you
[QUOTE=Robotboy655;52567780]Updated the wiki page for you: [url]http://wiki.garrysmod.com/page/ENTITY/Touch[/url][/QUOTE] Wouldn't it be every tick?
[QUOTE=code_gs;52567816]Wouldn't it be every tick?[/QUOTE] Same thing really
A better representation of the text would be: It is called once per tick for each entity the object is in contact with.. ie once for the world, once for the player, etc...
[QUOTE=Robotboy655;52567835]Same thing really[/QUOTE] Well there is a pretty important difference between frames on the server and actual ticks.
Sorry, you need to Log In to post a reply to this thread.