Setting collideSet depending on which object collided
3 posts • Page 1 of 1
Setting collideSet depending on which object collided
Hello all,
I'm making a simple circle spawn type engine, and I'm trying to add multiple pistons to one cylinder.. and attempting to change the spawned circle's collideSet depending on which object collided.
The "spark plug" object's onCollide is:
Theoretically, this should set the spawned object's collideSet to the value of the piston, plus group C, C being the killer of the object. What am I doing wrong here? The circle is only getting group A.
Thanks,
Jimmio
I'm making a simple circle spawn type engine, and I'm trying to add multiple pistons to one cylinder.. and attempting to change the spawned circle's collideSet depending on which object collided.
The "spark plug" object's onCollide is:
- Code: Select all
(e)=>{
Scene.addCircle({ radius = 0.1; pos = e.pos; collideSet := e.collideSet + 4 })}
Theoretically, this should set the spawned object's collideSet to the value of the piston, plus group C, C being the killer of the object. What am I doing wrong here? The circle is only getting group A.
Thanks,
Jimmio
- Jimmio92
- Posts: 1
- Joined: Sat Feb 27, 2010 11:59 am
Re: Setting collideSet depending on which object collided
- Code: Select all
(e)=>{Scene.addCircle({ radius := 0.1; pos := e.pos; collideSet := e.other.collideSet + 4})}
You forgot to type "other".
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Setting collideSet depending on which object collided
using just "e.something" addresses the command to the object the code is on while, e.other addresses the other object
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests