|
Post by cyber2016 on Jul 2, 2016 4:38:38 GMT
Hello, not sure if it's just me but I can't get the Spawn when Visible (Triggered Spawner) to work. However the Triggered on Collision works perfectly when both Player and collision object have Rigidbody; Player has Gravity.. Again this problem is keeping me up for Day's Lol.. I'm sure something I missed somehow. Thanks for any help.
|
|
|
Post by DarkTonic Dev on Jul 2, 2016 4:44:11 GMT
Keep in mind that there has to be a Renderer component on the same game object for it to "become visible". You can add a line of code to the OnBecameVisible method in TriggeredSpawner.cs if you want to see if the event is actually being fired. I reckon it is not.
|
|
|
Post by cyber2016 on Jul 2, 2016 13:48:09 GMT
Again thanks for the fast reply About the "Renderer component", yes I do have Mesh Renderer Component on the Pooled Object that I want it to "Spawn when Visible" however it Spawns as soon as I hit Play and it's out of Camera View. I want the Pooled Object only Spawn if in the Camera View.. Anyhow not sure if I'm forgetting about needing Special Layer or Something?
|
|
|
Post by cyber2016 on Jul 2, 2016 14:07:17 GMT
Hopefully I'm typing this out right. K so I've:
1/ Created a Cube object in the Maze with "Renderer component", actually it had this already. 2/ Than I Added the "Triggered Spawner" when visible to the Cube object, 3/ I dragged the "Red Dice" object into the "Prefab to Spawn" area, and I put this object into the "PoolBoss", 4/ I held onto my chair hoping a Miracle would happen LOL!... The "Red Dice" Spawns right away when I hit Play.. Basically the Visible Event is Triggered no matter where the Camera View is Facing..
|
|
|
Post by DarkTonic Dev on Jul 2, 2016 15:54:03 GMT
Again thanks for the fast reply About the "Renderer component", yes I do have Mesh Renderer Component on the Pooled Object that I want it to "Spawn when Visible" however it Spawns as soon as I hit Play and it's out of Camera View. I want the Pooled Object only Spawn if in the Camera View.. Anyhow not sure if I'm forgetting about needing Special Layer or Something? If it's out of camera view it will not fire OnBecameVisible. So that's working properly. You may wish to use a different event, like Enabled or OnSpawned.
|
|
|
Post by DarkTonic Dev on Jul 2, 2016 15:55:22 GMT
Hopefully I'm typing this out right. K so I've: 1/ Created a Cube object in the Maze with "Renderer component", actually it had this already. 2/ Than I Added the "Triggered Spawner" when visible to the Cube object, 3/ I dragged the "Red Dice" object into the "Prefab to Spawn" area, and I put this object into the "PoolBoss", 4/ I held onto my chair hoping a Miracle would happen LOL!... The "Red Dice" Spawns right away when I hit Play.. Basically the Visible Event is Triggered no matter where the Camera View is Facing.. Remember (you may not know) if the Scene view is showing your game object, then it's also considered "visible" even if you don't see it in game view. It's a Unity quirk that fools lots of people. So test this without Scene view, or zoom way out into a different area where you can't see your game object.
|
|
|
Post by cyber2016 on Jul 2, 2016 16:33:35 GMT
Wow! I didn't know about the Scene View.. Thanks! Oh I forgot to mention, not sure if my Unity 5.4b23 is possibly the reason but I'll try what you've suggested and I'll let you know soon..
|
|
|
Post by cyber2016 on Jul 2, 2016 16:47:57 GMT
Truly Amazing! K, it works TY! 1/ I hid the Object from the Scene View, 2/ The Red Dice only Spawns when in the Camera View; or if the Camera is pointed at the Red Dice behind a 15 Meter Tall Wall. 3/ Awesome, I Appreciate your Help! 4/ (Problem Solved)
|
|
|
Post by DarkTonic Dev on Jul 2, 2016 17:09:21 GMT
Awesome!
|
|