Entity-id
3 posts • Page 1 of 1
Entity-id
How can I use entity-id to affect a remote geometry?
For example: I want to change the force on a thruster using a script from a geometry or in the console. I know one can use 'this' and 'other' in OnCollide to affect another object, but it only affects the two objects in the collision. why can't I do something like this:
onCollide e=>{scene.1234.color={1.0,1.0,1.0,1.0]}
i.e. on collision of an object a specific other object with entity-id=1234 changes colour to white.
Of course this script does not work - but how would I achieve this?
For example: I want to change the force on a thruster using a script from a geometry or in the console. I know one can use 'this' and 'other' in OnCollide to affect another object, but it only affects the two objects in the collision. why can't I do something like this:
onCollide e=>{scene.1234.color={1.0,1.0,1.0,1.0]}
i.e. on collision of an object a specific other object with entity-id=1234 changes colour to white.
Of course this script does not work - but how would I achieve this?
- stephane.savanah
- Posts: 11
- Joined: Tue Feb 11, 2014 8:20 am
Re: Entity-id
You could do it for some entities.
For example in onSpawn of thruster put onSpawn=(e)=>{scene.my.thrusterID = e.this.entityId} and in onCollide of some geom put onCillode = (e) => {(scene.entityById(scene.my.thrusterId)).force = 10}
For example in onSpawn of thruster put onSpawn=(e)=>{scene.my.thrusterID = e.this.entityId} and in onCollide of some geom put onCillode = (e) => {(scene.entityById(scene.my.thrusterId)).force = 10}
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
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests



