Spawning an object with variable as property.
			7 posts			 • Page 1 of 1		
	
Spawning an object with variable as property.
I'm trying to spawn a box with density = {scene.my.density}, but it don't work.
I'm using this script:
Are there a way to spawn a object with variable as density, so I can change it?
			
		I'm using this script:
- Code: Select all
- scene.AddBox({pos:=e.pos; size:=[1,1]; body:=0; density:={scene.my.density}})
Are there a way to spawn a object with variable as density, so I can change it?
- 
				 
 savask
- Posts: 162
- Joined: Mon Oct 12, 2009 2:53 pm
- Location: Russia, Siberia
Re: Spawning an object with variable as property.
viewtopic.php?f=13&t=1322
			- Code: Select all
- (scene.AddBox({pos:=e.pos; size:=[1,1]; body:=0})).density = {scene.my.density}
Dream of Algodoo as game development engine...
		- 
				 
 Kilinich
- [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Spawning an object with variable as property.
Don't work in Phun.
			
		- 
				 
 savask
- Posts: 162
- Joined: Mon Oct 12, 2009 2:53 pm
- Location: Russia, Siberia
Re: Spawning an object with variable as property.
savask wrote:Don't work in Phun.
It works. I've check.
Dream of Algodoo as game development engine...
		- 
				 
 Kilinich
- [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Spawning an object with variable as property.
Oh, yes, it was my mistake. It don't work with scene.my.density = 0. 
One problem again: when spawner delates, density became a num value as usual.
			
		One problem again: when spawner delates, density became a num value as usual.
- 
				 
 savask
- Posts: 162
- Joined: Mon Oct 12, 2009 2:53 pm
- Location: Russia, Siberia
Re: Spawning an object with variable as property.
savask wrote:Oh, yes, it was my mistake. It don't work with scene.my.density = 0.
One problem again: when spawner delates, density became a num value as usual.
How it can be related with spawner? I think you misunderstood something.
Can you give an example scene?
Dream of Algodoo as game development engine...
		- 
				 
 Kilinich
- [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Spawning an object with variable as property.
I don't want to show my small thyme experiments to everybody   
 
But I can say more details:
I'm spawning a circle with the script which creates a box on collide. Then, circle delates (by setting density to very small value) and dynamic property changes back to usual.
			
		 
 But I can say more details:
I'm spawning a circle with the script which creates a box on collide. Then, circle delates (by setting density to very small value) and dynamic property changes back to usual.
- 
				 
 savask
- Posts: 162
- Joined: Mon Oct 12, 2009 2:53 pm
- Location: Russia, Siberia
			7 posts			 • Page 1 of 1		
	Who is online
Users browsing this forum: No registered users and 3 guests




