Maybe too complicated for me at this state
AirPlane in Unity 3d [C#]
Hello everybody ! Today i'm creating an Airplane game (in order to make an multiplayer battle game ( for me and my friends) and i was asking me: to make a good plane, must I put a rigid Body to all components of my plane or just to my motor ? this is my plane Object :
AirPlane (Empty Game Object)
Motor
Base
Fr_Wings
Bc_Wings
Else if you have some advices for me, i will enjoy read them :)
Bye, xyHeat
For the moment i put this code on the empty game object :
using UnityEngine;
using System.Collections;
using UnityEngine.Networking;
namespace AirCube
{
public class PlayerControl : NetworkBehaviour
{
void Update()
{
transform.position += transform.forward * Time.deltaTime * 35; // changed with a float
transform.Rotate(Input.GetAxis("Vertical"), 0.0f, -Input.GetAxis("Horizontal"));
}
}
}
Answer by xyHeat · Feb 16, 2016 at 01:59 PM
I have a problem with this code : if i put a rigid body on the plane, i lose the control and when it remove this component, my plane pass through block :/
Someone can help me ?
Dont modify transform.position or rotation. Use rigidbody ins$$anonymous$$d. However making a nice plane simulation is a little more involved than applying rotation like so.
I think that it's too complex for me at this state, I should learn more coding before lunch myself in this project ! So i will learn more the basics of deplacments with rigid body and addforce and all the other !
So I close this post and Bye ! :)
Follow this Question
Related Questions
Control accurate velocity and angular velocity 0 Answers
step 10 space shooter asteroid random rotation not working 4 Answers
Problem with Rigidbody.rotation and AddTorque() being together 0 Answers
Rotating kinematic rigidbody at run time(2D sidescrolling project) 0 Answers
How to AddForce to a Rigidbody from Game Objects Spawned from an Array, One Prefab at a Time? 2 Answers