3/27/2023 0 Comments Geometry wars 3 dimensions removed![]() ![]() I just tried to reproduce this in the editor using the 'Interact' demo by creating a sphere, sticking it in the middle of the grid (at the same Z height), and then attaching a VectorGridForce component to it. Tldr: The asset as it stands probably isn't suitable for all your needs, but if you're confident messing around with the code then it could provide a decent starting point for implementing itĬlick to expand.This code should work fine - if you have a look at the VectorGridForce.cs script that comes with the asset, this is almost exactly the way that I do it. It sounds like the second one might provide the effect you're after, but if not then its pretty easy to code custom force types (essentially just loop over all the grid points, check each one is within the force area, and if so then apply the force)ģ) Individual grid points can be locked in place, so won't be affected by forces - you could presumably do this for any points underneath your obstacles to prevent them from being moved.Ĥ) Yep, you can query the color of a particular cell quite easily (it actually requires a minor change to the code to make the grid point array public, but I'll roll that into the next update as I can see that being quite handy) A better approach might be to internally simulate a 'T' shaped 2D mesh (think of a cube unfolded into 2D space) but then render it as 3D cube.Ģ) Currently forces can either be applied in an outward radius from a given position (so all points are pushed away from the centre) or you apply a force to push all points in a particular direction. It probably wouldn't handle the edges of the cubes as you'd want though (any points affected by forces would sort of fly away from the edge of the cube rather than wrapping around). The basic principal of having grid points connected by springs could presumably remain unchanged, but the grid generation code would need to be changed fairly substantially to generate the points in a cube formation and then go through and connect them all up to their neighbors. I'm wondering how suitable your asset would be for all this, thanksġ) The cube idea might be feasible, but I think would require a fair bit of modification to the code. My game would also need to be able to query the grid to see what colour each cell was at present as the goal of my game is to paint the cube a particular colour. Also the force would need to be able to be manipulated for example my game would need barriers or obstacles on the cube that would stop the ripple effect if the plasma wave hit it. In my example the space ship would want to fire the ripple in a small arc rather than a complete circle in all directions. ![]() My other question is how easy is it to control the forces affecting the grid. My questions are one would it be suitable for a 3D cube ? In my game if the ripple got to the edge of the cube it would continue to wrap around the other side. Any chance you could add a version that makes it a 3D vector cube rather than than just a 2D square plane ? For a game I'm making I was looking for something that could let me fire plasma from a spaceship that is moving around a 3D cube with the objective being that when it fired plasma it would cause the verticies of the cube to ripple and change colour permanently as it passed over the grid much like your tool. I hope this proves helpful to some people out there! Please feel free to reply in this thread or PM me if you have any questions Alternatively, you can use C# functions to manually interact with the mesh. Interacting with the Grid via forces is as simple as attaching a VectorGridForce behaviour to any GameObject - the grid will then move and deform as the GameObject approaches it. Vector Grids are easy to implement into your game - you can simply drop one into your scene and it'll work nicely with the default settings, or you can dive into the Inspector and tweak spring behaviour and rendering options to your heart's content. * Full C# source code and example scene included. * Optimised code designed to be efficient, even on mobile devices. * Apply color changes along with physical forces. ![]() * Infinitely scrollable in any direction. * Fluid mesh system that dynamically responds to external forces. Perfect for adding a Geometry Wars-style futuristic background to your game! Vector Grid allow you create a dynamic, ever-changing neon grid that will stretch, distort and flow in response to forces from your game. I'm pleased to announce the release of Vector Grid on the Unity Asset Store ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |