Skip to content

RotorModule

dani0105 edited this page Oct 2, 2022 · 1 revision

Rotor Module

Last Update: 01/10/202

Description

This module is used for rotor part. It will calculate the thrust force taken from the environment variables and player input.

Implementation Requirements

In this section I will explain what module you need to implement in your part for a correct operation.

Variables Module

It is necessary to add a couple of variables for a correct operation. The following table will show the variables you need.

Variable Save Type Description
isOn [x] Bool Save if the rotor is on or off
flow_rate [ ] Double It is used to control resource drain.
throttle [ ] Double It is used to save throttle percentage.

Part Component

In the part component it is necessary to add an empty OnParts.

Imgur

Base GameObject

Your part needs to implement a game object named "Base"

Imgur

Animator Component

This is a bit more complicated to implement, because you need to do more steps to get it working.

First you need to create an animation controller with two states, you can name it whatever you want.

Imgur

Now you need to create a boolean parameter called "isOn"

Imgur

Next you need the parameter created above and add it as a condition between states

Imgur

Finally, you need add the animation controller into animator component in your part

Imgur

Note: this is just the settings, if you want to make animations you need to modify the state you created earlier. If you want to know more about Unity animations, check this article

Clone this wiki locally