Cloned objects not colliding with other objects (after upgrade to Unity 5.3)
Hi all,
This code was working in my game prior to upgrading to Unity 5.3. Now, not so much. I'm spawing a block that should collide with another block (all have 2D colliders that are not triggers) but they simply pass through each other on the same layer. Any help would be appreciated!
using UnityEngine; using System.Collections;
public class SpawnerScript : MonoBehaviour {
public float spawnTime = 5f; // The amount of time between each spawn.
public float spawnDelay = 3f; // The amount of time before spawning starts.
public GameObject [] enemy; // enemy prefab.
void Start ()
{
// Start calling the Spawn function repeatedly after a delay .
InvokeRepeating("Spawn", spawnDelay, spawnTime);
}
void Spawn ()
{
// Instantiate a random enemy.
int enemyIndex = Random.Range(0, enemy.Length);
Instantiate(enemy[enemyIndex], transform.position, transform.rotation);
}
}
Answer by WolfpackPancake · Dec 12, 2015 at 06:00 AM
Your Code May Not Work Because Unity Changed A Couple Of Things In The Update They Might Have The Awnser In The Update Log
Yeah, I'll have to tweak a lot of things in my game to cope with the upgrade. I guess I'll accept two steps forward and one back for all the awesomeness Unity provides :D I checked the update log and didn't see anything see$$anonymous$$gly relevant as of yet...
Your answer
![](https://koobas.hobune.stream/wayback/20220612052303im_/https://answers.unity.com/themes/thub/images/avi.jpg)