How can I create a boat or ship controller (and switch between boat controller and FPS)?

Hi everyone!

I am relatively new to Unity and I have to develop a short game set in an archipelago. I was thinking about employing a boat controller to make the player experience more realistic.

I found this tutorial on YT:

and therefore emplyed the following script for controlling the boat (Dropbox):

and this on for switching between boat and FPS controller.

Basically none of them worked; moreover, everytime I try to use a camera this jumps out of the boat and I have no clue about why this is happening.

I’d be so grateful to receive any piece of information / small hint.

thank you so much for your time!

-bri

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

Might want to work through some tutorials for transitioning between controllers. I imagine you’re on the right track, but you have to learn how to debug what you made.

To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

Doing this should help you answer these types of questions:

  • is this code even running? which parts are running? how often does it run?
  • what are the values of the variables involved? Are they initialized?

Knowing this information will help you reason about the behavior you are seeing.

1 Like

Thanks so much, and thank you for the useful information on how to present my question. I’ll try to check which parts are running, hopefully I can spot the issue.