Merge pull request #11002 from NathanWarden/vehicle_wheel_warning

Added a warning message when a VehicleWheel is not a child of a VehicleBody.
This commit is contained in:
Rémi Verschelde 2017-09-12 13:11:48 +02:00 committed by GitHub
commit 50eb62ea6e
2 changed files with 10 additions and 0 deletions

View file

@ -102,6 +102,14 @@ void VehicleWheel::_notification(int p_what) {
}
}
String VehicleWheel::get_configuration_warning() const {
if (!Object::cast_to<VehicleBody>(get_parent())) {
return TTR("VehicleWheel serves to provide a wheel system to a VehicleBody. Please use it as a child of a VehicleBody.");
}
return String();
}
void VehicleWheel::_update(PhysicsDirectBodyState *s) {
if (m_raycastInfo.m_isInContact)

View file

@ -131,6 +131,8 @@ public:
void set_roll_influence(float p_value);
float get_roll_influence() const;
String get_configuration_warning() const;
VehicleWheel();
};