Search Unity

  1. 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 Graphics Toolkit & Planets

Discussion in 'Assets and Asset Store' started by Darkcoder, Aug 18, 2012.

  1. AION-studio

    AION-studio

    Joined:
    May 3, 2018
    Posts:
    1
    ola tenho interesse. Mas queria saber se nessa versão comprada como faço pra integrar o player em cena. exemplo na versão de teste oque renderiza o universo e a câmera. O "SGT FLOATING Point". por esse motivo não da para colocar mas câmeras em sena não da pra colocar player porque a câmera já e o player. então queria saber se na versão paga e diferente.
     
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    English please?

    The free "basic pack" of the floating origin system is an old version. The universe feature in the full version of SGT is easier to use and has some different features.
     
  3. MsgCntrl

    MsgCntrl

    Joined:
    Jan 20, 2019
    Posts:
    2
    @Darkcoder,

    Hi, I'm a happy owner of Destructible2d & seeing as I don't have experience with floating origin systems & I had the need for lots of space your 'basic pack' seemed like the go to option but I'm having a few issues with it -

    1 - Moving the camera position using LateUpdate did not seem to work at all! station keeping with moving objects (eg orbiting asteroids) does not look good & jitters. To attempt to fix this I moved the contents of sgtFloatingCameras LateUpdate to onPreCull - this is working as expected but I think i'm noticing more hitching when 'snap' takes place - So the faster the object we constrain the camera to, the more noticable hitching we get.

    2 - We noticed that 'floatingObjects' can get into an unwanted state where their position only changes when snapping occurs when they should be moving every frame & we have not been able to figure out why - this was occuring when we were generating objects & adding the sgt components at runtime.

    3 - I did not realize it was an old version or a marketing asset for the larger pack. Could you explain the differences between the two versions of the floating origin system in detail?

    Many thanks!
     
    Last edited: Jan 21, 2019
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    The "Basic Pack" was originally designed to be some kind of marketing asset that gave users incentive to buy the full asset, but I now realize that a floating origin system itself is fairly complicated to implement in any game. Additionally, the name "Basic Pack" can imply that the full asset is somehow more advanced to implement, when it's actually the other way around. I could update the pack with the new even simpler implementation, but I've since changed the structure of SGT and it would now require me to include more portions of the SGT codebase (unless I write some code to exclude them when making different packages). So I'm not really sure what to do with it, I'll probably depreciate it and think up some other marketing idea. For now I've been updating Destructible 2D, Lean ___, and other stuff, so I'll leave it up until I get around to SGT.
     
  5. daliang2018

    daliang2018

    Joined:
    Aug 22, 2017
    Posts:
    10
    Hello, thank you for your help with my previous questions. I have adopted: StarfieldInfinite as my 2D game background, they are great.
    I used Starfield Infinite (Clouds) and Starfield Infinite (Stars) as two prefabs to load into my game as a background.
    There are now 2 questions:
    1. Prompt on the prefab, need sgtcameras, I have to add it to my camera, just as a background?Can not add it?

    2. This background is very beautiful, but I hope that my players can change some data in real time at runtime so that they will get the background they like and even enjoy each other.
    Then you need to allow the player to change some data,
    such as:

    public SgtSeed Seed;
    public int StarCount = 1000;
    public Gradient StarColors;
    public float StarRadiusMin = 0.01f;
    public float StarRadiusMax = 0.05f;

    I am in trouble, I am an independent producer, novice, lack of experience to do this step - allowing players to freely set the data.
    Do you know how to do it, how can I complete this idea?
    Is it time to assign values to these data and regenerate objects through a function?

    I look forward to your reply, thank you again for providing such a wonderful product.
     

    Attached Files:

  6. daliang2018

    daliang2018

    Joined:
    Aug 22, 2017
    Posts:
    10
    I found a function, UpdateMeshesAndModels();
    he can reset the scene, but I am not sure if it is correct.
    In addition, how to write a new seed?
     
  7. jparedes90

    jparedes90

    Joined:
    Feb 8, 2017
    Posts:
    2
    Hello! Ive recently been using this asset and I have a question and I am sorry if its been asked already.
    What is the best way to set the position of my ship when returning back into the game? I save the position of the ship whenever the player quits the game and it works fine if it never snaps into the origin. But once it snaps into the origin and I set the world position of the player, everything seems to be flying around. So lets say my snappedDistance is 100 but my actual position is 150 in the z-axis, how would I set that correctly?

    Currently using the Floating Origin method in case that helps.
    Thanks!
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    1 - You just need to add the SgtCamera component to your main camera (and any other cameras). This allows SGT to read velocity information, and roll information.

    2 - Yes, UpdateMeshesAndModels() should be called to update all of this. I'm currently working on an update that will make this simpler. To see what must be called, look at the code for the component you're editing. At the top you will see something like: DrawDefault("Symmetry", ref updateMeshesAndModels); This tells you that updating the Symmetry value requires a call to UpdateMeshesAndModels();

    To change the seed you can just assign any integer, it will automatically cast to SgtSeed. For example: starfield.Seed = 1234;


    If you're using the floating origin then your player (and all other objects) should be using SgtFloatingPoint to store their positions. If you do this then it's just a case of saving and loading the SgtFloatingPoint position data. Once loaded, you can call the "Snap" method on your SgtFloatingCamera, and everything in your scene should update to the correct positions.
     
  9. astearon

    astearon

    Joined:
    May 9, 2016
    Posts:
    15
    could you please help me with the following error?


    .Matrix4x4' does not contain a definition for `Rotate'
    i am getting this at a few scripts like SGTCamera, SgtShadowRing and SgtShadowSphere

    This happens on Unity 5.6.6f2 the 32bit one.
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    The latest version of SGT was submitted for Unity 2017.3.0f3. It's possible to modify these bits of code to make it run in 5.6.6, but the latest versions includes the Geosphere100 mesh, which won't work.
     
  11. kamicth

    kamicth

    Joined:
    Sep 30, 2018
    Posts:
    9
    Would you please help me ?

    i would like generating an infinite galaxy field…
    i thought to start looking from infinitestarfield but can't figure out how to replace stars quads by galaxies of stars.
    can you push me on the way ?
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    You can replace the SgtStarfieldInfinite.MainTex setting with a texture of your galaxy. If your texture has multiple galaxies then you can set the SgtStarfieldInfinite.LayoutColumns/LayoutRows settings, or change SgtStarfieldInfinite.Layout = Custom, and manually specify each galaxy rect within your texture. Just keep in mind this uses Additive Blending by default, so your galaxy texture should have a black background (like most galaxy pictures).
     
  13. kamicth

    kamicth

    Joined:
    Sep 30, 2018
    Posts:
    9
    thanks for the quick reply.

    using your suggestion galaxies are allways facing me wathever the direction i take to observe them, plus how can i make the transition between galaxy textures from sgtStarfieldInfinite to real volumetric galaxy like thoses generated by sgtSarfieldEliptical ?



    my concern is to create a universe with this feature : starting from an infinite galaxy fields and be able to dive onto those galaxies containing stars, then dive into those stars to see attached systems with planets moons and asteroids

    may be am taking the problem by the wrong way.

    after succeding that i ideally would like work having thoses scales navigating seamlessly through generated objetcs in an infinite universe :

    10E26m the filament structure of the supercluster clusters of galaxies
    10E24m superclusters
    10E23m clusters
    10E21m Galaxies
    10E19m nebulae
    10E18m starfields
    10E13m star systems
    10E8m planetary systems
    10E7m planetoids details
    10E6m aseroids details
    10E5m terrain low detail
    10E4m terrain basic details and large structures
    10E2m vegetaions and small structures, objects low details
    10E1m terrain and vegetation high details, objects standard details
    10E-3m terrain structures végétation and all objets at maximum details
     
    Last edited: Feb 12, 2019
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Oh I see, the SgtStarfieldInfinite component cannot be used to make a universe like you describe. This component is designed to quickly render lots of distant stars/nebulas/galaxies very quickly, and they may not look so good up close like this as you discover, and there's no way to make them transform into something higher detail on proximity.

    To make a hierarchical spawning system like this you need to use the Universe (floating origin system) feature, but there's currently no component to make an infinite universe, nor is there any example to make a structure as large as a universe. I plan to make an example like this, but I have about a thousand tasks to complete before I get to that, because it's a very difficult thing to implement, and no game really needs this.
     
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,181
    It isn't technically possible to fulfill your wish without some tricks and compromises. Try to think about ways you can narrow the scope of your open universe while giving the player a similar impression of zooming.
     
  16. kamicth

    kamicth

    Joined:
    Sep 30, 2018
    Posts:
    9
    @hopeful
    more and more games try to provide a huge environement : Minecraft, Elite dangerous, No man Sky, Dual universe, Star citizen and the list is growing everydays.... so its definitly not impossible
    i think FOS componant of SGT would be a good base to do that. i also apreciate many of SGT features even if some of them can't actualy fill my needs
    i never said it would be easy. plus technicaly i dont want the whole universe loaded in the scene at any moment, just the nearby objects detailed, far visible object baked or heavily simplified and finaly the rest have not to be computed until its not needed to rendering nor interactions.
    i'm not affraid about coding to fill the gap if a find a good solution
    my aproach is to go step by step and finding the best assets / tools to simplify my work.
    first i want to find a way to make some sort of transitions or something else.
    i've looked at universe generator and others assets by curiosity and have somme reflection trails.

    @Darkcoder
    is it possible to set a minimum distance view for each element generated with SgtStarfieldInfinite in order to cull them ?
    is it possible to avoid textures orientations to follow the camera ?
    is it possible to replace static texures (near and far) by some computed shaders like its done in universe generator asset ?
    is it possible to get positions of inner quad objects to generate detailed similar objects with an other componant ?
     
    Last edited: Feb 13, 2019
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    The starfield feature just isn't designed for this use case, nor will it be in the future. If you need this much flexibility you should use the SgtDebrisGrid component, which will procedurally spawn GameObjects around the camera. I'm still working on updating and expanding each feature though, so there isn't a comprehensive example scene of how to combine this feature with the universe LOD system.
     
  18. generaltofu203

    generaltofu203

    Joined:
    May 9, 2018
    Posts:
    40
    Hi there! I was wondering if your asset has a planet surface does that mean I can land and walk around the surface?Is there a collider for the entire planet? your asset states something about Newtonian physics and thrusters, does that mean you already have a physics system inbuilt?
     
  19. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Yes, the planet surface has colliders. As long as your character controller can walk on round objects then it should work.

    The SgtThruster component has settings for applying Rigidbody force using Unity's built in 3D physics system, there is no custom physics system.
     
  20. Cuong160296

    Cuong160296

    Joined:
    Dec 26, 2018
    Posts:
    1
    Hello sir ! i just bought this asset and i have a question. that is where can i get orbit visual (mesh filter). Thanks for reading and sorry about my bad English
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Orbits and orbit visuals are part of the floating origin system (Universe). e.g. "Space Graphics Toolkit/Features/Universe/07 + Orbit Visual".
     
    Cuong160296 likes this.
  22. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    96
    Are there built-in functions that allow the spiral galaxy to instantiate a planet or any other game object as soon as you approach a star?
    and is the spiral galaxy also possible in the floating origin system?
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    The starfields all generate static meshes that are designed to render very fast, so there is no way to detect or run custom code when you approach a star within them. You can position them using the floating origin system though. To make them spawn stars I recommend you embed 'real' stars or star clusters within the spiral starfield, then have those spawn things on proximity. The floating origin system examples demonstrate how to spawn things based on proximity to a specified spawner/GameObject.
     
  24. Rubin-de-Bruin

    Rubin-de-Bruin

    Joined:
    Apr 17, 2015
    Posts:
    2
    Hi Darkcoder,

    So far I'm oving both the SGT and the extra world packs. Really nice work.

    The only thing I keep getting is an error when I'm using a Cloudsphere. It says the following about the cubemap.

    Error assigning cubemap texture to 2D texture property '_MainTex': Dimensions must match
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    It doesn't give me a script error, and doesn't lead me to the error when I click on it.But it seems to be happening on the OnEnable event. I tried different cloud maps, but it happens with the Cloudsphere1 and the Dense clouds the same way. It does it when I made my own planet, but also with the standard earth and sun. I'm using Unity 2018.3.4f1.

    Do you have any ideas why this keeps happening? Or is there a workaround?
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Thanks. As far as I know this is just a bug with Unity's shader preview rendering. I don't think there's any mistake with my code.
     
  26. Quiet-Pixel

    Quiet-Pixel

    Joined:
    Aug 23, 2013
    Posts:
    44
    I am having trouble with SgtShadowRing flickering on and off when the planet rotates or moves. I can reproduce the problem by opening the "Features/Ring/04 + Ring Shadow" demo and moving the Planet around in XYZ, or rotating it. When the scene loads, the ring does NOT cast a shadow on the planet. Moving it slightly will find a location where the shadow flicks on and is stable. Rotating the Planet does the same thing, causing the shadow to flick on and off.

    I tried removing the SgtShadowSphere component in case the ring and sphere shadows were conflicting. No change.

    Also tried tweaking all the parameters in the SgtShadowRing, SgtShadowSphere, SgtLight, Ring scripts, camera clipping distances, light ranges, shadow types, etc. Nothing seems to prevent the issue.

    Anyone else seen this?

    [Unity2018.3.6f1 on Mac]
     
  27. Quiet-Pixel

    Quiet-Pixel

    Joined:
    Aug 23, 2013
    Posts:
    44
    Update: I found a temporary work around:

    SgtShadowLayer (which was applied to the Planet sphere to receive the ring shadow) calls SgtShadow.FilterOutMiss () in the CameraPreRender () function. If I modify SgtShadow.FilterOutMiss and comment out the following line, the shadow is now stable as the planet rotates or moves:

    Code (CSharp):
    1. if (point.z > 0.0f)
    This probably breaks something else in other shadows, but for now it fixes the problem I was having.
     
  28. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    83
    Does this work ok with Rift? And also wondering if anybody knows whether this will work with google seurat?
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Thanks, I'm aware of some issues with the shadow system that I'm trying to fix.


    Last time I tested, all the effects work in VR. The stars/dust are billboards though, so they may not look so immersive up close.
     
  30. Rubin-de-Bruin

    Rubin-de-Bruin

    Joined:
    Apr 17, 2015
    Posts:
    2
    My colleague and I debugged the error. And we have a workaround:

    In the shader SGTCloudsphere we've renamed the _mainTex property to a new name of _customTex. (we've added this to your SGTshader definition).

    Then in the UpdateMaterial function of the SGTCloudsphere we've applied the cubemap to our _customTex instead of the _mainTex.

    It seems to only be a problem when a cubemap is applied on a property that Unity normally assumes is a SpriteRenderer.

    We've speculated that it might be something with Unity trying to make a preview of the shader and instead of using your custom shader it tries to apply it to a standard Unity shader (one where _mainTex is reserved for 2D textures). Making a non Unity standard property stops Unity from assuming it's a 2D texture as default.

    Anyways this approach worked for us. We aren't getting any errors atm.
     
    GainfulSage and Leewhitt like this.
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Thanks for finding a solution! If that's the issue then perhaps changing the SubShader tag "PreviewType" to "Skybox" would fix this. Last time I looked into this issue I couldn't reliably reproduce the error though.
     
  32. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    24
    Hello Darkcoder, is it Possible to fix this polar distortion on planet?
    Many Thanks


    upload_2019-2-26_22-52-8.png
     
  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    To reduce the distortion you can use a higher detail mesh (e.g. Geosphere100). There's no way to map a cylindrical texture like this to a sphere and have no distortion though. A more complex approach you could do is to manually flatten your normal texture around the poles of your planet, and if you use the SGT Planet shader then that can apply separate normals to the poles and equator, giving you vastly reduced distortion.
     
  34. SteveSteiner

    SteveSteiner

    Joined:
    Mar 7, 2019
    Posts:
    3
    Hello Darkcoder, thank you for this great Asset. I have stumbled upon a problem for me:
    Now, at first I had the MainCamera set to Perspective Mode, in which no problems whatsoever arose.
    When I changed that to Orthographic, however, what I see in the Editor no longer matches what I see in the game.

    This is in Editor:
    PlanetInEditor.PNG
    And the following what it looks like in the game.
    PlanetInGame.PNG
    Now this is apparently due to the fog in the SgtAtmosphere(disabling it removed the problem), I've tried playing around with the options, but didn't manage to get the look from the editor. I hope you can help me.
    I'll supply you with the SgtAtmosphere-Settings as well.
    AtmosphereSettings.PNG
     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    This is because the atmosphere shader calculations are done based on a 3D camera point, whereas for an orthographic camera these calculations would have to be done differently.

    To 'fix' this you should move your orthographic camera back and extend its far clipping plane distance (e.g. 1000 units). Doing this mimics what the calculations would look like if they were designed for orthographic, where the distance you move back depends on the scale of your scene, and how much you want to eliminate the issue.

    Last time I looked into this I believe there would have been a performance penalty from detecting and switching these calculations, so I didn't. I could take a look at the code again after I finish this next big update though.
     
    SteveSteiner likes this.
  36. SteveSteiner

    SteveSteiner

    Joined:
    Mar 7, 2019
    Posts:
    3
    Yes, that worked like a charm, thank you very much. I'll be keeping this one in mind when performance-testing is being done, testing it on my workstation made no difference. Both @~750fps.
    I'm gonna test it on a weaker computer and report, how that one fares.
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    Great!

    When I refer to performance, I'm talking about modifying the shader code to automatically detect when you're using an orthographic camera, and use different calculations so you don't have to move the camera back manually.

    There should be no performance penalty from doing it manually as you are now.
     
    SteveSteiner likes this.
  38. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    226
    Curious how close HDRP support is? The SGT Planet shader in HDRP/LWRP is of high interest. Last we saw posted about it was in quote above and then 1 month ago on the asset review section as a reply to kamicth

    Anything scheduled for release in next few weeks HDRP wise?
     
  39. SteveSteiner

    SteveSteiner

    Joined:
    Mar 7, 2019
    Posts:
    3
    Okay then, gotcha :) Thanks again.
     
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,109
    I'm currently in the process of updating all of my assets to support LWRP & HDRP, as well as update them to use some new code and project design ideas I've been experimenting with, as well as updating them to use the new documentation system I developed, as well as release some new assets, as well as working on some freelance projects. I'm currently about half way through all of this, but SGT is a very large project so it will take the most amount of time to do. I would also like to see this new update as soon as possible, but there's just so many tasks in my queue that it will take some time.
     
  41. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    226
    cool, gotcha. if you were so inclined to say setup a gitlab private repo and allow us who wouldn't mind helping under your guidance I'd be down for that. just better setup than trying to do myself and asking back and forth on forum. esp if the work i would volunteer to the project would be actually going towards the next release so i can be assured i am not doubling work and the changes we come up with to support it are the way it will be etc.
     
  42. Leewhitt

    Leewhitt

    Joined:
    Nov 29, 2017
    Posts:
    4
    I don't suppose you'd be able to share the updated Shader file? My competence with Shader code is near 0 and I'm having the same issue.

    I did actually try the tag change as suggested below, but this didn't help in my case.
     
    GainfulSage likes this.
  43. Shadowmage45

    Shadowmage45

    Joined:
    Apr 28, 2016
    Posts:
    6
    Hello;

    Strongly considering purchasing this asset package (which looks absolutely awesome for my purposes from the listed feature-set), but I had a few quick questions that would help make the choice...

    Currently I'm investigating mostly for the atmospheric shaders and effects, but might also be looking into full-scale-planet-terrain-LOD systems in the future.

    In the project that I'm investigating this asset for, I am using a custom floating origin system that utilizes multiple cameras and game layers to render both near and arbitrarily far objects (distant objects rendered as scaled down models in background cameras; fairly standard stuff), with the camera always at world origin in these scaled layers -- Will the various atmosphere and planetary effects be able to play nicely with this setup (i.e. can the 'unit scale' be arbitrarily adjusted for each object, and with no limitation on relative object positioning)?

    Secondarily (and of less concern) -- are there options to download versions compatible with older Unity releases? Currently stuck on 2017.1.x due to one of the other projects I'm working on (KSP Mods); can likely work around this issue one way or another regardless of the answer.

    Any info offered is much appreciated;
     
  44. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    191
    Something i'm highly interested in is procedural clouds, and procedural texture generation. Would fit this amazingly. Another thing would be a planetary grass shader, able to put grass on certain points on the planet with height based values.
     
  45. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    281
    Hi, I just found your asset in the Unity asset store and it look amazing. I am thinking about buying your kit. In the video you say "1:1 scale floating origin system, 46.6+ billion light-years". How can you handle those distance in the Unity editor? I made my own floating origin system with ECS and it works pretty well, but my solar system has a scale of 1:50000 and it is a pain to work on it in the editor.
     
  46. assimoes

    assimoes

    Joined:
    May 31, 2016
    Posts:
    7
    Hello !

    I have been following this package with great interest, but I'm not sure if the Floating Origin System would play well with multiplayer games? I know it works quite well in singleplayer games...but my question is how would this work when syncronizing the player position to an authorative server (like Photon for example)?
    I might be wrong but looking at the demos the Global position of the player stays at 0,0,0 and only the local coords are changing...

    Has anyone tried using the SGT Floating Origin System in a multiplayer game?
     
  47. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    281
    Hello,

    that is a good question. I think it should work but you must store all positions of other players in doubles and write them back to the transforms so all players have the correct positions. I think in a multiplayer game you must send this double precision positions to the other clients, but I am not sure about it.

     
  48. assimoes

    assimoes

    Joined:
    May 31, 2016
    Posts:
    7
    thanks for the response mate. It does make sense what you are saying...I was thinking about the same (and fearing exactly that)
     
  49. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    281
    Why fearing? It's a challange. :)
     
  50. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    281
    Here is a double precision Vector Libraries for Unity3D. That could make it easier for you. Just add it to your scripts folder to use it.

    https://github.com/sldsmkd/vector3d
     
unityunity