<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Detect collision in server Colyseus (Solved)]]></title><description><![CDATA[<p>Hello everyone,<br />
I'm using Unity for client-side and i want to detect collision in server to anti-hack. How to implement it?</p>
]]></description><link>http://discuss.colyseus.io/topic/780/detect-collision-in-server-colyseus-solved</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 11:05:57 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/780.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Oct 2022 04:20:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Detect collision in server Colyseus (Solved) on Fri, 14 Oct 2022 09:02:58 GMT]]></title><description><![CDATA[<p>Hello everyone,<br />
I'm using Unity for client-side and i want to detect collision in server to anti-hack. How to implement it?</p>
]]></description><link>http://discuss.colyseus.io/post/2168</link><guid isPermaLink="true">http://discuss.colyseus.io/post/2168</guid><dc:creator><![CDATA[hoaihau]]></dc:creator><pubDate>Fri, 14 Oct 2022 09:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Detect collision in server Colyseus (Solved) on Invalid Date]]></title><description><![CDATA[<p>Hi!<br />
You should use a JS library like Box2dJS: <a href="https://box2d-js.sourceforge.net/" rel="nofollow">https://box2d-js.sourceforge.net/</a><br />
or detect them yourself like: if distance (ball1,ball2)&lt;ball1.radius+ball2.radius ...<br />
on server side.</p>
]]></description><link>http://discuss.colyseus.io/post/2169</link><guid isPermaLink="true">http://discuss.colyseus.io/post/2169</guid><dc:creator><![CDATA[COCO]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Detect collision in server Colyseus (Solved) on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/873">@coco</a> thank sir</p>
]]></description><link>http://discuss.colyseus.io/post/2170</link><guid isPermaLink="true">http://discuss.colyseus.io/post/2170</guid><dc:creator><![CDATA[hoaihau]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Detect collision in server Colyseus (Solved) on Thu, 13 Oct 2022 20:54:50 GMT]]></title><description><![CDATA[<p>I do this on my server with no framework (not saying the framework isnt a better option, just wanted to contribute).</p>
<p>Whenever a players x or y is updated i run this function which is inside the player class on the server.</p>
<p>It essentially loops through all the other players in the room, and compares their x and y coordinates to the 1 player who just moved.  If the other_players.x is &lt; (player.x-0.4) &amp;&amp; other_players.x is &lt; (player.x+0.4) that means they are touching in terms of x axis (my players are about 1 unit wide.</p>
<p>then if other_players.y is &lt; (player.y-0.2) &amp;&amp; other_players.y is &gt; (player.y-0.5) that means my player is higher than them at about head level.   You would have to play with the values depending on your character size</p>
<p>If both of these are true i run the function to kill them and send that message to all the connected clients where they can vanish the player.  I also add them to an array with a timeout so that if they are in that array they cannot be killed again within 2 seconds</p>
<p>Hope this helps someone!</p>
]]></description><link>http://discuss.colyseus.io/post/2180</link><guid isPermaLink="true">http://discuss.colyseus.io/post/2180</guid><dc:creator><![CDATA[mitchmeyer1]]></dc:creator><pubDate>Thu, 13 Oct 2022 20:54:50 GMT</pubDate></item></channel></rss>