Raised This Month: $51 Target: $400
 12% 

Detecting the end of touch?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 01-07-2016 , 03:18   Detecting the end of touch?
Reply With Quote #1

Is there anyway to detect the end of touch of two entities (prop_dynamic and player)?
They have no collision.

So basically, when a player stops touching the prop.

I was wondering if this could be also done cheap performance-wise?
dilalmon is offline
uurbyrkdr
Senior Member
Join Date: Apr 2015
Old 01-07-2016 , 05:31   Re: Detecting the end of touch?
Reply With Quote #2

Maybe SDKHook_EndTouch?
uurbyrkdr is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-07-2016 , 09:48   Re: Detecting the end of touch?
Reply With Quote #3

Quote:
Originally Posted by uurbyrkdr View Post
Maybe SDKHook_EndTouch?
What he said.

Having said that, you'll have to attach this hook to each prop_dynamic you want it to apply to.

Just remember to check that the other entity is in the player range (entity 1 through MaxClients).
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 01-07-2016 , 11:22   Re: Detecting the end of touch?
Reply With Quote #4

I thought SDKHook_EndTouch was what it did, but while the player is standing on top of it (since there is no collision), SDKHook_EndTouch gets called like every frame.
dilalmon is offline
cam0
Senior Member
Join Date: Feb 2015
Old 01-07-2016 , 13:52   Re: Detecting the end of touch?
Reply With Quote #5

Quote:
Originally Posted by dilalmon View Post
I thought SDKHook_EndTouch was what it did, but while the player is standing on top of it (since there is no collision), SDKHook_EndTouch gets called like every frame.
Those hooks work better for triggers. Maybe enclose the prop_dynamic in a slightly bigger trigger_multiple and hook that instead.
__________________
cam0 is offline
Reply



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 10:48.


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