#How to change/ update prefab for object spawning in script
21 messages · Page 1 of 1 (latest)
You may create and configure a new scene object and set it as a prefab input. Or do you want to be able to change it in a runtime?
I replaced the existing cookie into this character head but the problem is it isnt falling down it is being just spawning in the target itself
Could you please guide me how and where to change existing prefab to our own in the script of mouth catching tutorial on LS community web
hi! yes! It the mentioned guide they also add a little script to the object prefab
I tried changing prefab name in the script spawning is happening but it isnt falling down
there should be Object Spawner script added to Object spawner Scene Object, and another script added to the Object Prefab itself. Could you please drag your Object Prefab prefab to scene, select it and screenshot? so we can see what components are there
Looks like there should be an ObjectPrefab.js script here, it controls object's position
I don’t think the script looks like this? I remember that there were some input components in there
I'm still in infinite instantiation tuto-1
- please make sure this input has a Object Spawner script hooked up and 2. Click
Applyat the top of inspector panel to apply change to the prefab
Perfect , It worked
Thank you for helping me resolve this...
😅 I have one more query what changes should i make in the script to make prefab go right to left
You may try to modify the script , there is a place where it sets the y component of a currentpos.y -= fallingSpeed * getDeltaTime(); and swap it for x! it should be relatively simple, Let us know if you have any trouble!
Hi @shrewd eagle does the old spawner script not work with the new versions of LS? I tried using the script from LS 4 in 5 but I keep getting an error when I send it to Snapchat to preview it