Problem with onCollide script?
3 posts • Page 1 of 1
Problem with onCollide script?
This is the script I'm using for a circle:
(e)=>{
scene.AddCircle({
pos = e.pos;
radius = 0.2;
color = [1, 1, 0, 1];
collideSet = 5;
heteroCollide = true
})
}
It's working and all but there is a problem, the 'attributes' of the spheres that the circle produces also makes the 'producing circle' have it's attributes. Let's say I have an onCollide script that makes a circle make more circles with a color of yellow and density of 2.0, once the main circle creates a circle, the main circle becomes yellow and have a density of 2.0 too, and I want the main circle to still have it's old attributes. Is there something wrong?
(e)=>{
scene.AddCircle({
pos = e.pos;
radius = 0.2;
color = [1, 1, 0, 1];
collideSet = 5;
heteroCollide = true
})
}
It's working and all but there is a problem, the 'attributes' of the spheres that the circle produces also makes the 'producing circle' have it's attributes. Let's say I have an onCollide script that makes a circle make more circles with a color of yellow and density of 2.0, once the main circle creates a circle, the main circle becomes yellow and have a density of 2.0 too, and I want the main circle to still have it's old attributes. Is there something wrong?
- v0xc
- Posts: 6
- Joined: Fri Sep 03, 2010 3:31 pm
Re: Problem with onCollide script?
Yes, a simple mistake actually.
In thyme "=" means to change an already existing variable. For your purpose you want to create a variable.
":=" Is for creation of new variables.
Good Luck
In thyme "=" means to change an already existing variable. For your purpose you want to create a variable.
":=" Is for creation of new variables.
- Code: Select all
(e)=>{
scene.AddCircle({
pos := e.pos;
radius := 0.2;
color := [1, 1, 0, 1];
collideSet := 5;
heteroCollide := true
})
}
Good Luck
-

Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests



