<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Car collision]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=415&amp;type=atom"/>
	<updated>2012-08-09T14:56:48Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=415</id>
		<entry>
			<title type="html"><![CDATA[Re: Car collision]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2355#p2355"/>
			<content type="html"><![CDATA[<p>Hello, if that&#039;s just for sound on wall collision i would suggest to link a simple box on top of the car :<br />(warning : butchered example)</p><p><span class="postimg"><img src="https://dl.dropbox.com/u/19970067/MaratisShots/spaced.png" alt="PunBB bbcode test" /></span></p><p>Then in script :</p><p>bbox = getObject(&quot;bbox&quot;)<br />Sound0 = getObject(&quot;Sound0&quot;)</p><p>soundplay = 0</p><p>-- scene update<br />function onSceneUpdate()</p><p>&nbsp; &nbsp; bboxcoll = getNumCollisions(bbox)</p><p>&nbsp; &nbsp; if bboxcoll &gt;= 2 then -- you might have to change value here<br />&nbsp; &nbsp; &nbsp; &nbsp; if soundplay == 0 then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; playSound(Sound0)<br />&nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; soundplay = 1<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; soundplay = 0<br />&nbsp; &nbsp; end<br />end</p><p>Hope it helps</p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2012-08-09T14:56:48Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2355#p2355</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Car collision]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2346#p2346"/>
			<content type="html"><![CDATA[<p>Hello, I have been trying to work out how to make the car from the physics demo play a sound when colliding with anything that isn&#039;t itself. I&#039;d rather not have to write out if IsCollisionBetween statements for everything I want it to make a sound with colliding with. So far i&#039;ve tried using getNumCollisions with no luck. Could anyone please help?</p>]]></content>
			<author>
				<name><![CDATA[Almighty Laxz]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1037</uri>
			</author>
			<updated>2012-08-09T08:15:03Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2346#p2346</id>
		</entry>
</feed>
