Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

Space Combat Kit (VSXGames) [RELEASED]

Discussion in 'Works In Progress' started by Billy4184, Jul 14, 2015.

  1. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    172
    I don't need it ! TNX ! I wrote a litte controller.
     
  2. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,413
    Glad to hear it! Sorry for the delay, I've been crunching on some freelance work and keeping up pace on the update. Let me know if you have any questions or queries about anything else.
     
    frankadimcosta likes this.
  3. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    56
    HI Billy,
    Just wondering if you have any documentation (even a change log) for the next update. Would be handy if I could grab a copy now. Cheers!
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,413
    Hi, sorry I don't have the docs done yet.

    This is less of an update and more like a re-write. Pretty much every script has been reworked and often split into smaller ones. It's going to be a massive change, but there's no way around it to make the improvements that need to be done.

    The update has also been delayed a bit, it slipped my mind that I hadn't done the AI but it's done now and the code is much better organized than before. I'm putting together the demos again atm.
     
    joshua_42 and JFI66 like this.
  5. navy3001

    navy3001

    Joined:
    Jun 1, 2017
    Posts:
    12
    How would I make the Hostile fighter indepent? because pretty much what I want to do is have them spawn to music, which I can not currently do to how they currently work, how would I make the prefab be its own thing?
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,413
    Basically you can spawn a game agent, spawn a fighter, and make the game agent enter the fighter. For the game agent, I suggest creating a prefab from one of the AI in the GameplayDemo scene, so that it has all the necessary control scripts etc attached. Let me know if you need any more info.
     
  7. navy3001

    navy3001

    Joined:
    Jun 1, 2017
    Posts:
    12
    i tried to do that, it just became a dead ship with a white name around it
     
  8. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,413
    Did you call EnterVehicle on the game agent component, and pass the ship reference?

    Is the AISpaceFighterControl script running?
     
  9. rickytsmith

    rickytsmith

    Joined:
    May 22, 2013
    Posts:
    22
    Just a quick head's up for anyone using the Gimbal Controller for turrets in 1.21. The Horizontal Arc limits is not working out of the box. You can see this in the turret test demo. In the GimbalController.cs method TrackPosition() the following lines need modifying.
    Code (csharp):
    1.  
    2. // Get the desired angle for the horizontal gimbal on the horizontal plane (wrt the gimbal parent forward vector)
    3.             float desiredLocalHorizontalPivotAngle = toTargetAngle_HorizontalPlane;
    4.  
    5.             // Take constraints into account
    6.             if (!noConstraints)
    7.                 Mathf.Clamp(toTargetAngle_HorizontalPlane, -horizontalArc / 2f, horizontalArc / 2f);
    8.  
    needs to be changed to :
    Code (csharp):
    1.  
    2.  
    3.  // Take constraints into account
    4.  if (!noConstraints)
    5.           toTargetAngle_HorizontalPlane=Mathf.Clamp(toTargetAngle_HorizontalPlane, -horizontalArc / 2f, horizontalArc / 2f);
    6.  
    7. // Get the desired angle for the horizontal gimbal on the horizontal plane (wrt the gimbal parent forward vector)
    8.        float desiredLocalHorizontalPivotAngle = toTargetAngle_HorizontalPlane;
    9.  
    In the original code the Mathf.Clamp result is never set to a variable - the first parameter is not an OUT so will not change the value. In any case this value is then never used to calculate the horizontal arc because the desiredLocalHorizontalPivotAngle ( which is used for this purpose) is assigned to the value before it is clamped.
    Caused me a few headaches so thought I would post this here for anyone else tearing out their hair over this issue.
    Hopefully this will already be fixed in the update
     
    Last edited: Jun 26, 2019 at 3:42 PM
    Billy4184 and JFI66 like this.
  10. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,413
    Thanks for pointing it out!