Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Space Combat Kit (VSXGames) [RELEASED]

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

  1. shivansps

    shivansps

    Joined:
    Feb 26, 2014
    Posts:
    60
    I imported directly from the asset store, i will try that.

    EDIT: Ok now i understand what happened, if i import the package directly from my account and choose to install the dependencies there is a error about missing stuff in "package manager ui" that i cant fix. So the only way to get it working was using a clear project and skip install dependencies, but post processing was missing.

    So:

    1) New 3D Project
    2) Manually install Post processing package on package manager
    3) Import SCK, skip install dependencies.

    Now work whiout errors.

    EDIT: oh and thanks i was able to do the changes to the controls i wanted, and also i easily added roll and pitch to capital ships. Very easy modifications.
     
    Last edited: Mar 26, 2020
    Billy4184 likes this.
  2. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Glad to hear you got that sorted, and found it easy to customize the controls!

    The package manager UI errors however can be resolved simply by uninstalling the 'Package Manager UI' package straight after installation. This is something Unity include as a dependency that really shouldn't be.
     
  3. Bluejay1666

    Bluejay1666

    Joined:
    Jun 25, 2013
    Posts:
    5
    Hi,
    Quick question, how do I detect who/what fired the weapon that inflicted damage on a vehicle?

    Thanks
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    The function that is called on the Damageable component includes a parameter 'damageSourceRootTransform'. This is the root transform of any vehicle that fired the weapon. From there you can compare it to the player vehicle root transform, or access any of the key scripts there.
     
  5. Bluejay1666

    Bluejay1666

    Joined:
    Jun 25, 2013
    Posts:
    5
    Doh, I should have thought of that. I just needed to set it correctly on my weapons health modifier script and it's working.

    Thanks for the help.
     
    Billy4184 likes this.
  6. Bluejay1666

    Bluejay1666

    Joined:
    Jun 25, 2013
    Posts:
    5
    Following on from detecting of being hit how would I go about changing the vehicle team and then refreshing everything so that takes affect? i.e. the target boxes update, the AI starts attacking, etc
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    The best way would be to have the Game Agent (player or AI) exit the vehicle, change their team, and then enter the vehicle again. The Game Agent Vehicle Setup Manager should take care of the rest.
     
  8. Bluejay1666

    Bluejay1666

    Joined:
    Jun 25, 2013
    Posts:
    5
    Yeah that works once I take account of the team being protected on the Game agent. Another way that worked was to update the trackable team and the target selectors.

    However my approach is wrong anyway. What I'm trying to achieve is to have two ships attack each other regardless of their team. e.g. one neutral ship shoots another so they then start attacking but all neutral ships shouldn't attack each other.

    I'm going to continue investigating how to do it.

    Great asset by the way I'm having a lot of fun just playing around to see what I can do with it.
     
  9. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    The best way to do that would be to get a reference to the attacker's Trackable component and pass it directly to the Target Selector via the Select(Trackable) method.

    I intentionally made it so that the Target Selector does not check every frame if the currently selected target is selectable - it only performs checks for new targets selected by the code inside the component. This means that you can pass any target manually and it will remain selected until it goes out of range. Makes it easier to set up bespoke gameplay.

    Great to see you're having fun with this kit!
     
  10. JimTheHermit

    JimTheHermit

    Joined:
    Oct 24, 2019
    Posts:
    22
    Okay, I took a break from this but now I'm back. I deleted the PackageManagerUI and the errors went away. I still don't know how to work this. In the simple demo, the ship spins backward. Pressing S makes the backward spin into a backward loop. Other demos that I could find, the ship spins backward around a point near the back wing
    I tried reading the manual but can't keep my eyes open after page 7 (the 5 pages of camera setups made it feel like 50 pages). I tried the Youtube Quickstart videos, but they're too obsolete to work (UVCEventManager?).

    Is there a step-by-step guide somewhere to teach me this?
     
  11. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    The tutorial videos for this kit are now on vimeo: https://vimeo.com/user102278338
    I did this so that I could update the videos as the kit evolved, which isn't possible on youtube.

    The current documentation can be found here:
    https://www.dropbox.com/s/5rfhkpu9vkuw0xm/SpaceCombatKit_2.0_UserGuide.pdf?dl=0

    Setting up the camera is very quick and easy, take a look at this video that just got updated:


    The simple demos are used to demonstrate very isolated features of the kit, which is something many customers asked for. If you're talking about the SCK_SimpleDemos_FlightControls, it has no camera setup, it's just the player, the ship, and the flight controls script. Which is why you would have seen the ship spinning around in front of the camera.
     
    Adrad likes this.
  12. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Hey everyone, the Space Combat Kit is currently HALF PRICE in the Unity Asset Store Spring Sale!

    This feature-packed starter kit will give you a massive head start on your next game!

    Check this out too, the Space Combat Kit was featured in a video by Unity:



    While they used a bunch of other assets to create different parts of this game, ALL the game features could have been achieved with the Space Combat Kit alone!!!

    Get your copy of the Space Combat Kit now!
     
    JFI66 likes this.
  13. tgg_unity

    tgg_unity

    Joined:
    Jan 14, 2015
    Posts:
    1
    I very like this Asset, I think it's one of the best assets in Asset Store.
     
    Billy4184 likes this.
  14. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Thank you! Glad you like it. Let me know if you think of anything else you'd like to see in this kit, and don't forget to leave a rating on the store :)
     
  15. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    12
    When changing the active scene and registering a new radarscenemanager, I am getting a missing reference exception stating that the objectpool was destroyed and is no longer accessible. There is a new objectpool in the scene, so I'm not sure why I'd need to register anything when I'm using the new radarscenemanager. What would be the best way to go about changing scenes and not having these things break?
     
  16. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    @Hellgeist please post the full error from the console. The likely issue is that the error actually occurred in the last frame of the previous scene, after some objects had been destroyed due to changing scenes.
     
  17. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    12
    MissingReferenceException: The object of type 'ObjectPool' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    VSX.Generic.ObjectPool.CreateNewObject () (at Assets/VehicleCombatRadar/Scripts/Pooling/ObjectPool.cs:64)
    VSX.Generic.ObjectPool.Get (Vector3 pos, Quaternion rot) (at Assets/VehicleCombatRadar/Scripts/Pooling/ObjectPool.cs:52)
    VSX.Vehicles.HUDVisor.AddWidget (Int32 _typeIndex) (at Assets/VehicleCombatRadar/Scripts/HUD/Visor/HUDVisor.cs:589)
    VSX.Vehicles.HUDVisor.Visualize (ITrackable target) (at Assets//VehicleCombatRadar/Scripts/HUD/Visor/HUDVisor.cs:650)
    VSX.Vehicles.HUDVisor.LateUpdate () (at Assets/VehicleCombatRadar/Scripts/HUD/Visor/HUDVisor.cs:896)
     
    Last edited: Apr 20, 2020
  18. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    I can help you sort this out, but that is a very old version of the Space Combat Kit. Have you tried downloading the latest version from the store?
     
  19. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Keywise and JFI66 like this.
  20. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    12
    I'm using version 1.2, which is the latest Vehicle Combat Radar. But I can try re-downloading and setting it up again, if you think that is the best course of action.
     
  21. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Ah I thought you were using SCK. I'll take a look at this and get back to you.
     
  22. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    Hi, I have a problem. I have two computer screens. When I control the spaceship's steering, the mouse will run to another screen, which is very annoying. I tried to change "CursorLockMode.None" to "CursorLockMode.Locked" but the spaceship will no longer be able to turn with the mouse. How should I solve this problem?
     
  23. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Hi, if you replace the Game State Manager script in your project with the attached script, you will see the option to set the cursor lock mode for each of the game states in your game.

    upload_2020-4-27_13-43-25.png

    For every game state where you want the cursor to move freely inside the window without going off into your other monitor, set the cursor lock mode to Confined.
     

    Attached Files:

    AngelBeatsZzz likes this.
  24. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Are you carrying the HUDVisor from one scene to the other using DontDestroyOnLoad or similar?
     
  25. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    After I set the "Cursor Lock Mode" of "SCK_Gameplay" to "Locked", the spacecraft will no longer be able to rotate with the mouse.
     
  26. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Did you try setting it to Confined?
     
  27. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    When "Cursor Lock Mode" is set to "Confined" the spacecraft can rotate, but the mouse will be able to run to another screen. It seems that "Confined" did not work.

    You can simply test this by turning off the "Maximize On Play" option, when the mouse is used to rotate the spacecraft, the mouse will run from the Game window to the editor window and display itself.
     
    Last edited: Apr 27, 2020
  28. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    I don't think there is any way to prevent the cursor from going outside the game window in the editor. The solution I provided is only for standalone builds.
     
    AngelBeatsZzz likes this.
  29. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    You are right, the standalone build is fine. thank you for your reply.
     
    Billy4184 likes this.
  30. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    Hi, I read the documentation, I created an empty scene, I completed the "Control The Vehicle" step but I cannot control the spacecraft, and there is no error message. I use prefabs provided in the kit.
     
  31. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Did you try this tutorial video:

     
    AngelBeatsZzz likes this.
  32. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    I just watched the video and now I can control the spaceship.

    I follow the video "Universal Vehicle Combat Series-Setting Up The Vehicle Camera" to set up the camera, but the camera does not follow the spaceship. Do you know what's going on?
     
  33. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    What happens exactly? Did you add a Camera Target to your ship, and one or more Camera View Target components?
     
  34. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    I completed all the settings according to the tutorial. I can switch between different cameras, but the camera does not follow the spaceship. The camera does not move. I checked the video three times and there should be no different settings.

    Here are two screenshots:

    20200508131018.png

    20200508131048.png
     
  35. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    The spaceship I use is "SpacefighterFriendly.prefab", which itself has a "Camera Target" component and two "Camera View Target" components.
     
  36. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Hi, if you go through each of the HUD elements:

    - Target Boxes
    - Target Hologram Controller
    - Radar3D
    - Cockpit

    They have a CameraViewParenter component. On one of these components, the Camera View Parenting Items list has an unassigned Transform value in one of its items.

    I've added a clearer error message (which you can see in the following image where I have reproduced the issue) to give you more information to solve it, and I'll PM the updated script to you.

    upload_2020-5-9_10-40-33.png
     
    AngelBeatsZzz likes this.
  37. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    I got it, thank you.
     
    Billy4184 likes this.
  38. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    Hi, I have two questions.

    1. How to let the enemy attack the player? I finished the "SCK Tutorial-Spawning Enemies" tutorial and can spawn enemies, but the enemies will not attack the player, it will fly for a few seconds and then stand still.

    2.How to set the battlefield range so that AI can fly in this range?
     
  39. dev_2051

    dev_2051

    Joined:
    Jul 25, 2013
    Posts:
    91
    Hi Billy, now as SCK has fully matured with all the nice features implemented in it do you have any plans to take up multiplayer add-on again?
     
  40. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Sorry I missed this question.

    1. The enemy ships have a Tracker (basically a radar) and a TargetSelector (which you can see assigned to the Weapons component).

    Whatever target is selected by the TargetSelector is what the AI will go after. So make sure it is set up to be able to select the type and team of the player. Same goes for the Tracker component.

    2. There is currently no setting for this. However, you can go to the SpaceshipCombatBehaviour script and add code to its BehaviourUpdate function that returns False if the player is too far from where the AI is operating. This will kick the AI to the next behaviour in the list, which is formation/patrol.

    I recommend inheriting from the script to make your changes, as this will prevent the changes from being overwritten when you update the kit.
     
    AngelBeatsZzz likes this.
  41. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Not at the moment. The issue with multiplayer is that it's much more complex than the base kit code, and will likely require a lot of support. Also every new feature will take longer to do to keep it compatible with multiplayer. Right now I can't commit to that.

    I'm expanding into different kits (such as the recently released Mech Combat Kits) which share a lot of the framework built for SCK. At some point it might make sense if I can do multiple multiplayer modules for the work of one (or close to it). But I can't promise it to you.
     
  42. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Hey everyone, the Space Combat Kit is currently 30% off for a Unity sale, if you've been thinking about grabbing it now's the time!
     
    JFI66 likes this.
  43. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    Hey everyone, added the ability to debug what is happening with control scripts when the player enters a vehicle.

    If you check the Debug Initialization checkbox on any input script, it will send messages to the Console telling you any reason why that script fails to start, or tells you if it successfully starts.

    upload_2020-5-22_0-7-30.png
     
    JFI66 likes this.
  44. ron_5656

    ron_5656

    Joined:
    Feb 7, 2020
    Posts:
    1
    Hello.
    A person who purchased a space combat kit.
    I want to create an original game using this, but after adding the player vehicle script to the player fighter, I'm having trouble lock on Enemy on the HUD.
    (In the video, the another player vehicle is generated just like the demo scene, just by switching the camera.)
    I am looking for knowledge of the script that is generating the playervehicle when I press the play button in the demoscene.
    video- https://twitter.com/ru_tuku/status/1264876514199269378
    Thank you.
     

    Attached Files:

    Last edited: May 25, 2020
  45. Altair44

    Altair44

    Joined:
    Oct 22, 2019
    Posts:
    10
    I don't know if anyone has already asked, but I would like to know, can this asset do this?



    I leave a comment from the creator about some of the code he used for those who are interested.

    "At a high level, the secret sauce is all in a relatively recent physics function called GetPointVelocity. To get this working, there are two classes. A FrameDragger, which would be the big ship that drags other ships around, and a FrameDragReceiver, which is the little ship. The FrameDragger doesn't really do much, it mostly just wraps some function calls and does some book keeping and has a radius for how big its influence is. Meanwhile the FrameDragReceiver does almost all the work. Here are two code snippets from FrameDragReceiver which do the magic:

    lastDragVelocity = dragger.GetPointVelocity(transform.position);
    lastDragAngularVel = dragger.Rigidbody.angularVelocity * Mathf.Rad2Deg;

    In principle what's happening here is that I call rigidbody.GetPointVelocity on the FrameDragger. This function figures out the velocity that would be happening at that specific point from the FrameDragger's point of reference. This also takes into account rotations, so for example if you had a rotating fan, you could call GetPointVelocity on a tip of one of the fan blades and it would show what the velocity would be at that instant at the tip. I also get the angularVelocity of the FrameDragger in preparation for applying that angular velocity to myself so that I also rotate with the FrameDragger.

    transform.position += lastDragVelocity * Time.deltaTime;
    transform.Rotate(lastDragAngularVel * Time.deltaTime, Space.World);

    Here, the velocities that I got earlier are applied. The velocity is in meters per second, so assuming you're applying this in your Update (FixedUpdate if you're using rigidbody physics) you multiply by deltaTime as usual and just add it to your current position. The same thing happens for rotations.

    What I'm leaving out is some polish stuff like a smooth transition but if you get far enough to implement that stuff then smoothing the transition from getting fully dragged around to not when entering/leaving the FrameDragger's area of influence isn't too difficult."
     
    closetgeekshow and Billy4184 like this.
  46. Altair44

    Altair44

    Joined:
    Oct 22, 2019
    Posts:
    10
  47. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    Hi, how to let the player to enter the vehicle like in the Demo?

    I added the "Game Agent" component to the player. I called GameAgent's EnterVehicle method, but the vehicle did not launch.
     
  48. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    I'll look into that, thanks!
     
    Altair44 and westryder907 like this.
  49. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,443
    You mean you're trying to launch a ship that is landed? How are you entering the ship, using the trigger collider and the F button?
     
  50. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    226
    Yes, I put the spaceship on the ground, set "Is Kinematic" to true, set "Current State" to Landed, and finally control the character to go to Trigger and press the F key to call the "gameAgent.EnterVehicle(vehicle);" method . As a result, nothing happened.
     
unityunity