Raised This Month: $9 Target: $400

[tf2] hook when physics objects collide?

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Join Date: Dec 2018
Old 10-18-2019 , 12:31   [tf2] hook when physics objects collide?
Reply With Quote #1

Im wondering if there is a way to test when a physics object (pipebomb, stickybomb, milk, jarate, etc [it does work with all flairs, but not gaspasser]) hits another?

I am spawning in a model and setting the solidtype to vphysics, It triggers with rockets fine, but no physics objects. I have tried all collision groups, but none work. Any ideas?

int entity = CreateEntityByName("prop_physics_override");
	if (IsValidEntity(entity))
		SetEntityModel(entity, model);
		DispatchKeyValue(entity, "StartDisabled", "false");
		TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
		SetEntProp(entity, Prop_Send, "m_usSolidFlags", 12); // FSOLID_NOT_SOLID|FSOLID_TRIGGER
		SetEntProp(entity, Prop_Data, "m_nSolidType", 6); // SOLID_VPHYSICS
		SetEntProp(entity, Prop_Send, "m_CollisionGroup", 2); // COLLISION_GROUP_DEBRIS
		AcceptEntityInput(entity, "Enable");
		SDKHook(entity, SDKHook_StartTouch, Hook_OnTouch);

public Action Hook_OnTouch(int call, int client)

Last edited by foon; 10-18-2019 at 14:19.
foon is offline

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 03:37.

Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode