i’ve been using Unity for a few weeks now and i love it. i’m currently trying to create a spot the difference game and i’m coming across some problems. currently i’m using planes and have materials on them to draw the differences. what i’m trying to do is have Plane parent with 5 empty gameobject children that just hold the position of where i want to draw the differences for the each picture. Where i’m having trouble is creating the a plane at the right position and rotation and size with the materials it needs. i know how to create a primitive plane but how do i do the changes i need and tell it what material it needs to draw.
you would use renderer.material to change the material.
you can also use instantiate to create the plane, rather than creating a primitive.
I am not sure I follow your question though? Why do you need the separate planes? How do you draw the differences on them?
well what i’m doing is making the extra pieces draw on a separate plane right in front of the main picture. the reason i’m doing this is because when a difference is found on one picture the other picture will match. so i need to be able to add and drop extra images. i know the best thing to do would be to use texture2ds but i’m not familiar with those yet and right now i’m currently in test mode. so i need be able to see what is where and what it’s doing. right now i am instantiating a prefrab which is a plane and has the image. the problem i’m coming across is when i’m trying to delete the object i created. heres the part of my code that isn’t happy.
print(prefrab.name);
print(“create clone”);
SpotScript clone;
/print(“create copy of script”);
clone = (SpotScript) prefrab.GetComponent(typeof(SpotScript));
//print(“destroy object”);
clone.DestroyScript(true);
//Destroy(prefrab);
print(“should be done”);