Script + Spaceship


Just quickly, here is a combined result of 3d spaceship design and the spaceship script for you guys to try out, enjoy!

[arrow keys] pitch and yaw

[z and x] throttle

[w, a, s, d] strafe

[q and e] roll

[left ctrl] fire

-Stopsecret

Click to Play

 

 

 

 

 

Published by

waylonlathern

(stopsecretdesign.wordpress.com) I have been doing 3d for awhile now and have become skilled in both the worlds of 3d design and game development. As such, i have created a blog to show my artistic talent and share tutorials with others :)

8 thoughts on “Script + Spaceship”

  1. Hi SS I have a question for you. I saw all your great work and my question is if you want to join LNA. We have a unity coder already (bincredible) but he got some problems with the inventory and I with the server so I hope you could help!
    Thanks for you awnser!
    Brick5492

    1. Brick, thank you for your invitation, but for now, I will be declining from working on LNA. 🙂 Hope that this does not offend you. Should I want to join at a later date, I can contact you.

      -SS

  2. I keep coming back to this controller. Here is a c# version with lots of easy customizations built in the inspector.
    using UnityEngine;
    using System.Collections;

    public class CustomflightControler : MonoBehaviour {

    public float turnspeed = 5.0f;
    public float speed = 5.0f;
    public float trueSpeed = 0.0f;
    public bool trueSpeedShiftLOCK = true;
    public float trueSpeedPosShift = 0.0f;
    public float trueSpeedNegShift =0.0f;
    public bool LOCKSetMaxMin = false;
    public float SetMax = 10.00f;
    public float SetMin = -3.00f;
    public float strafeSpeed = 5.0f;
    public float powerShift = 0.0f;
    public float rollShift = 0.0f;
    public float yawShift = 0.0f;
    public float pitchShift = 0.0f;
    public Vector3 strafeShift = new Vector3(0,0,0);

    void Update () {
    if (LOCKSetMaxMin) SetMin=SetMax;
    if (trueSpeedShiftLOCK) trueSpeedNegShift=trueSpeedPosShift;
    float roll = Input.GetAxis(“Roll”)+rollShift;
    float pitch = Input.GetAxis(“Pitch”)+pitchShift;
    float yaw = Input.GetAxis(“Yaw”)+yawShift;
    Vector3 strafe = new Vector3((Input.GetAxis(“Horizontal”)*strafeSpeed*Time.deltaTime), Input.GetAxis(“Vertical”)*strafeSpeed*Time.deltaTime, 0);
    float power = Input.GetAxis(“Power”)+powerShift;
    //Truespeed controls
    if (trueSpeed (-3 -trueSpeedNegShift)){
    trueSpeed += power;}
    if (trueSpeed > SetMax + trueSpeedPosShift ){
    trueSpeed = (SetMax-.01f) + trueSpeedPosShift;}
    if (trueSpeed < (SetMin -trueSpeedNegShift)){
    trueSpeed = (SetMin-.01f) – trueSpeedNegShift ; }
    if (Input.GetKey("backspace")){ trueSpeed = 0;}
    rigidbody.AddRelativeTorque(pitch*turnspeed*Time.deltaTime, yaw*turnspeed*Time.deltaTime, roll*turnspeed*Time.deltaTime);
    rigidbody.AddRelativeForce(0,0,trueSpeed*speed*Time.deltaTime);
    rigidbody.AddRelativeForce(strafe+strafeShift);
    }
    }

    have fun but be careful what you adjust.

Leave a reply to Terry Morgan Cancel reply