Object Spawning Help (with materialName)
2 posts • Page 1 of 1
Object Spawning Help (with materialName)
A friend of mine is making something. Maybe a Marble Race.
Now he had set an object's materialName to, let's say, "foo".
He wants to add an object like, "spawn the 'foo' here when another object hit me".
Is there a possible way to do that?
I mean spawn the foo, the spawned object must depend on foo and not hardcoded.
Thanks a lot to those who even bother seeing this post!
Expecially those Thyme experts!
Now he had set an object's materialName to, let's say, "foo".
He wants to add an object like, "spawn the 'foo' here when another object hit me".
Is there a possible way to do that?
I mean spawn the foo, the spawned object must depend on foo and not hardcoded.
Thanks a lot to those who even bother seeing this post!
Expecially those Thyme experts!
onCollide:
(e)=>{
System.exit;
}
(e)=>{
System.exit;
}
- HumanoidX
- Posts: 3
- Joined: Tue Jun 23, 2020 10:39 am
Re: Object Spawning Help (with materialName)
inside your sample object, put this in poststep:
(e)=>{
scene.my.sampleObject=entity
}
then, in your trigger(oncollide or whatever) you use this line
newObj=scene.cloneEntityTo(scene.my.sampleObject,[SOMEPOSITIONHERE])
after that you can edit the properties of the newly summoned object by editting the properties of newObj, for example:
newObj.color=[1,1,1,1]
(e)=>{
scene.my.sampleObject=entity
}
then, in your trigger(oncollide or whatever) you use this line
newObj=scene.cloneEntityTo(scene.my.sampleObject,[SOMEPOSITIONHERE])
after that you can edit the properties of the newly summoned object by editting the properties of newObj, for example:
newObj.color=[1,1,1,1]
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests