One feature I focused on was scene transitions using trigger objects to change the location and position of the camera. I did this by making a bunch of empty Gameobjects in the editor and storing them in a list on a script in the camera along with a list of trigger objects. Each trigger object also stored another object in a script that would make a boolean true when only both objects collide. The empty objects in the camera were named CameraAnchor (x) where whenever I duplicated an object x would increase representing each clone created, I used this feature in the script so that it automatically adds each duplicate to the list with a loop increasing x until it cant find anymore duplicates. Since the trigger objects were all named differently I had to manually insert them by making the list public, then I made another list of the Trigger script that referenced each script inside the object to get the bools, I did this so that I can manipulate the trigger script list without worrying about resetting the trigger object list. Then I made a for loop that would check if any of the trigger scripts outputs true and when it did I the camera move to the next duplicate and remove that trigger script from the list so it cant return true twice. I made the camera progress to the next object by using the list the CameraAnchors are stored in and simply increasing the int in the array reference every time it got a true boolean.
oh and I made the see saws by slapping a HingeJoint component on the objects and unless you set a parent rigidbody for it to hang on it just pivots in the air by default which was pretty straightforward.
I didn't have a .obj file from the OBDF class but I had this Donut I was making to learn Blender with, it's not a closed mesh so it causes major problems and crashes but I managed to make it work with the mesh collider by using the basic inflated vertex setting and exporting it without all the subdivision smoothing effects.
No comments:
Post a Comment