Boat Switch/ Controlling

The task at hand is making on the ability to switch from the person to the boat and control them. Unity is really good at this as you can turn off individual things in the scene or in an object. You are able to find an object in code and find features in the object and turn the on and off. I will be using this ability to make it so you can switch through the person and the boat. You are only allowed one active camera in a unity scene at a time.  When driving the boat I will turn off the camera on the FPS Controller and make the camera on the boat active vice versa.

When the mode is switched to boat, the camera on the FPS Controller will be turned off and the FPS Controller will be set to the position of an empty object on the boat, the empty will be a child of the boat so it will always be at the same place on the boat every time. When you get of the boat I will also turn is kinematic to off so the boat does not move off when you dock on the island.

As a stretch goal, I am planning on making it so you can only get off the boat when within a radius of it. I currently do not know how to do this so I will have to do some research. Currently the code is limited to using 2 different keys to get on and off the boat and there is no radius. I also want to implement a radius to the boat and the functions. I feel once I have learnt the radius code I will be able to apply it to a few things throughout the scene. I would also like to have the on and off button for the boat set to the same key but currently do not know this either.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s