Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Leaderboard


Popular Content

Showing content with the highest reputation since 02/06/2019 in all areas

  1. 5 points
    I know I know, tons of minecraft like stuff out there but I started working on something for my 5 year old last friday. He's still loves minecraft and I couldn't find anything worth a crap that was minecraft related and vr for ios so decided to make it myself. Like I said, I only just started it a little over a week ago but a big chunk of it is already done outside of some minor glitches (like tree leaves not going where theyre supposed to go if it's on the side of another chunk). Alot of stuff has not been added like water physics (outside of drag when walking in it), no ai yet, haven't tuned in some of the algorithms for block generation, no menu or large inventory or anything yet. It does run very quickly tho so don't be afraid to use max settings, even if you are on a less than average pc But if you would like to try it in it's current state, I'll post a link below. Once it's close to being finished and before I add vr I will post the source here in the forum. (right click) to remove a block. (left click) to place a block. (q) and (e) cycles which block your holding. Mouse is currently not locked for testing reasons so watch where you click and there is no boundary barriers in place yet HERE IS THE LINK TO THE BUILD
  2. 3 points
    Hello! I'm glad to present you my latest work! It's a dynamic 2d field of view. You can edit it's quality, angle and length. Everything works smoothly and nicely. Objects that are not visible disappear. Here you have example images: And also example of usage: License: - You can use it for commercial and non commercial projects - You don't need to credit me (but it's still nice to see!) - You can't share it on other websites - You can't call this asset as your own! Dynamic 2D FOV.unitypackage
  3. 3 points
    Hello there, its been a while since i've posted something in here, so i thought i could give it a try and making an actual devlog on my current project. Its a strategy, turn based tile game in which your main goal is to have the most tiles conquered at the end of the game. Its a pretty simple concepts, but its quite fun. There's some thought process involved when making every turn and calculate opponents predictions, so gameplay wise, its pretty cool so far. Feedback is highly appreciated Right now it has: Core mechanics, such as generating tiles in a balanced way, placing them, conquering enemy tiles etc... Pretty color lerps lol Flexible match system that allows to make various game modes and story based stuff Smart AI that uses reward system and calculate all the best solutions for an optimal move. Main menu Modifiers Here are some screenshots P.S I felt pretty anxious when uploading this to public, but after couple days i managed to do it
  4. 3 points
    hello guys started working on prop/tool pack for selling purpose . pack price would be 10 $ and will contain 32 models or more . this is models i have already finished working on, C&c welcome . For 3d viewer: https://www.artstation.com/nika7586
  5. 3 points
    Bullshit! Respectfully I understand what meant your cousin, but honestly I have a doubt about his skill regarding this question. I could argue a few hours with you, but I prefer only quote some games which are good - and bankable - if you think that you need money developing your own projects : SuperHot, FireWatch, LayersOfFear, CupHead, TheRoom, MonumentValley, BroForce, Poney Island, SolarGun, Inside, HandOfFaith, Endless Space2, SubNautica, and more more more. I played almost all games which I quoted previously - and they are really good - better than some sh** which had been released using Unreal Engine Maybe Unity is not the best, the most beautiful, efficient or something else - OK (I don't agree), but it is not the least. I cannot imagine myself working on another engine. Take a look at the link below and you can see that many interesting games ($$$) have been developed under Unity. Considering all efforts that the Unity team does today so as to increase quality and power of their engine, I guess that the future will be amazing for Unity and its community ++ https://en.wikipedia.org/wiki/List_of_Unity_games
  6. 2 points
    As usual, just a few words to say that soon starts the next Ludumdare session. If you dare, accept the challenge - create a game in less than 72 hours. according a chosen theme. If you want to participate, share here a link and this way I can take a look at your project. I will evaluate it with pleasure. I am in ++
  7. 2 points
    STR!PES is my entry for the 44th LudumDare. This is a procedural game. In my project there is only code - some procedural generation for shapes and stripes - no sprite, no prefab, no physics, no implicite value (excepted a radius PI). I optimized each part of code so as to reach the lowest execution using a simple (but efficient) pooling system and an improved implementation of coroutine. Also I use a leaderboard on-line so as to save best scores. Take a look at the video below. STR!PES is available for free on Itch.io ++
  8. 2 points
    This is the end of the 44th LD. I did a SuperHexagon clone - all is displayed using procedural generation, pooling system and an improved implementation of coroutines ++ https://ldjam.com/events/ludum-dare/44/strpes
  9. 2 points
    Hi Fellows! Sometimes we use always the same functions or commands in order to code an action or a behavior. These lines are often used in scripts, but it is possible to optimize code. I would like to share some tips here just to start a new section. If you have an useful idea (maybe just one line) and if you want to share it with us, give us a brief explanation and why this alternative is better than the previous. Don't forget that sometimes the simplest things are better than hardest. Best regards ++
  10. 2 points
    It's basic - when you know the semantic. Thank you ++ I prefer this one - thank you for your help. I really appreciate ++
  11. 2 points
    Don't want to sound like a unity fanboy, but Unreal Engine is so bad when it comes to load times, i can find a wife and get two kids until my game loads if its on hdd. It also frustrating that its not very friendly when it comes to minimizing the application. Unity is not going anywhere, its a great platform for starters and indie companies and imo indie companies often produce better quality games than some triple A games.
  12. 2 points
    Hey all! I've finally been able to work on my multiplayer FPS Gunmetal again and it's coming along pretty well. I've been able to redo the menu and add a custom game launcher that is able to patch, add more weapons, and the ability to go prone. The map is also a new addition. Let me know what you think along with what I should add or remove. Thanks for the support and the feedback! Hopefully, I will be able to release a stable Alpha soon for testing.
  13. 2 points
    https://www.humblebundle.com/store/grid2-spa-bathurst Grid2 for free ++
  14. 2 points
    This last week I've been migrating my website over to a new web host. I've decided to put up some of the artwork I've created over the years. These are items that have never seen the light of day, and offer them to you all for free. I am not using them, so no point in hording them. I intend to keep digging through my backups and adding new content as I go. http://fatboxsoftware.com/resources.html
  15. 2 points
    https://freebies.indiegala.com/welcome-to-princeland-sp-version/ Welcome to Princeland, the south east of Oman Sea. This is a place which is used by powerful countries to do drug trials and technology experiments. A place that has 800% tax rate, where you can barely stay alive. You are a part of the rebellion against the prince who exploit his people with taxes. Gather the best weapons, vehicles and followers to crush his army. By upgrading your skills, challenge him at different difficulty mods. After his funeral, we will all able get weapons, vehicles and followers tax-free. If you dare - I cannot. The story seems so boring
  16. 2 points
    Thank you for such an amazing kit. I made an army men mod from your kit for a class in school to show off my level design project. I chose your kit because I found it to be free. It's the perfect solution for a top ramen-surviving college student like me that can barely afford anything on the Unity app store. Very quickly I think it's important to mention that I don't have any intentions to make a commercial game from your FPS kit. I'm sure you wouldn't like that. Moreover, after dissecting your game and trying to make my own enemies, I came across a variety of issues. I made my enemies exactly like yours and yet they walk up to the player but don't shoot. I shoot them and they run away. Therefore I wanted to ask, how did you set up your enemies? Perhaps more specifically how did you make them fire and attack the player? I was wondering if perhaps quick documentation would be a good idea. I would love to learn more about how you set up this kit; if you have the time. Also, I noticed an issue where the AK clip doesn't show up on reload animation and for both guns there is no ammunition pickup. Anyhoo, you're kit is amazing and using the Unity HDRP render pipeline makes everything look even more amazing. I'll add some screenshot bellow.
  17. 2 points
    Really interesting. Nice aesthetic. There is here a good potential. However I would like to ask you about something which could offend you (sorry) - this is not my will. Why are you wasting so many time and energy, developing a game, which you cannot sell because you have no copyright? Maybe you don't want to sell something and you are developing this project as a fan. Clearly you have skill so as to do something good. Respectfully why don't you want to create your own game? I wish you the best ++
  18. 2 points
    Working on a simple shader so as to apply a picture on screen, I found a way to create a broken glass shader like in Metro 2033. Also you can use this shader to create a frozen effect. I guess that it could be interesting for FPS project as damage FX or something else... As usual I use a sub folder callad MyShaders where my shaders are. Take a look at the link where I posted a picture ++ https://imgur.com/a/m2TC8ex PS : I use this texture in my project ++ https://yandex.com/collections/card/5aaa1d47be1d770087ac9f00/ using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class BrokenScreenFX : MonoBehaviour { public Texture2D texture; [Range(0, 1.0f)] public float Amplitude = 0.5f; [Range(0, 1.0f)] public float Bias = 0.5f; Camera cam; private Shader BrokenScreenShader = null; private Material BrokenScreenMaterial = null; bool isSupported = true; void Start() { CheckResources(); if (texture == null) texture = Resources.Load("BrokenScreen") as Texture2D; } public bool CheckResources() { BrokenScreenShader = Shader.Find("MyShaders/BrokenScreen"); BrokenScreenMaterial = CheckShader(BrokenScreenShader, BrokenScreenMaterial); return isSupported; } protected Material CheckShader(Shader s, Material m) { if (s == null) { Debug.Log("Missing shader on " + ToString()); this.enabled = false; return null; } if (s.isSupported == false) { Debug.Log("The shader " + s.ToString() + " is not supported on this platform"); this.enabled = false; return null; } cam = GetComponent<Camera>(); cam.renderingPath = RenderingPath.UsePlayerSettings; m = new Material(s); m.hideFlags = HideFlags.DontSave; if (s.isSupported && m && m.shader == s) return m; return m; } void OnDestroy() { #if UNITY_EDITOR DestroyImmediate(BrokenScreenMaterial); #else Destroy(BrokenScreenMaterial); #endif } void OnRenderImage(RenderTexture source, RenderTexture destination) { if (CheckResources() == false) { Graphics.Blit(source, destination); return; } BrokenScreenMaterial.SetFloat("_amplitude", Amplitude/100); BrokenScreenMaterial.SetFloat("_bias", Bias * 100); BrokenScreenMaterial.SetTexture("_MainTex2", texture); Graphics.Blit(source, destination, BrokenScreenMaterial); } } Shader "MyShaders/BrokenScreen" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _MainTex2 ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { Cull Off ZWrite Off ZTest Always CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma fragmentoption ARB_precision_hint_fastest #pragma target 3.0 #include "UnityCG.cginc" uniform sampler2D _MainTex; uniform sampler2D _MainTex2; uniform float _amplitude; uniform float _bias; uniform float4 _ScreenResolution; uniform float2 _MainTex_TexelSize; struct appdata_t { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; }; struct v2f { float2 texcoord : TEXCOORD0; float4 vertex : SV_POSITION; float4 color : COLOR; }; v2f vert(appdata_t IN) { v2f OUT; OUT.vertex = UnityObjectToClipPos(IN.vertex); OUT.texcoord = IN.texcoord; OUT.color = IN.color; return OUT; } half4 _MainTex_ST; float4 frag(v2f i) : COLOR { float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST); float2 uv = uvst.xy; float2 brokenUV = uv; float3 fracture = (tex2D(_MainTex2, uv).rgb * _amplitude); fracture += (tex2D(_MainTex2, uv).rgb * _bias); brokenUV += float2(fracture.r, fracture.r)/512; float3 sum = tex2D(_MainTex, brokenUV).rgb; sum = sum + (fracture * _amplitude); return float4(sum, 1.0); } ENDCG } } }
  19. 1 point
    solved by myslef (using the second scirpt posted by me) setting kinematic to true on grab object, and use gravity to false and blocking object constraints by script when object held by player. and unfreezeing contraints and turn gravity in again when object is dropped by the player... now my grab script works fine as i want and as expected andi can integrate it in my main project template.. and have pickup, throw object rotation by button when held by the player and collision detection so when player held object and object collide with another static gameobject or with another ridigdbody gameobejct it falls.. this is to simulate contact between obejct and to prevent object flipping ,,, btw thanks again. ..for all help....
  20. 1 point
    What do a difference between a shoot and a melee attack? Maybe the distance. There is the same mechanic - excepted that your raycasthit go ahead, but not too far. However personally I prefer to use a OverlapSphere. Create a position a little bit beyond player and set a radius. If an enemy is inside the sphere, you hit it. This way you can simulate a swipe movement ++ https://docs.unity3d.com/ScriptReference/Physics.OverlapSphere.html
  21. 1 point
    My understanding of code doesn't mean that it's always for a game. But in the same time, I remember a game in which you have to escape using doors with numbers - only prime numbers guarantee safe rooms - others are traps This game is called Bryan Audley's Numbers - it's not a really good game, but its mechanics are interesting. Also the main gameplay of this game reminds a great movie - Cube which I highly recommend ++
  22. 1 point
    Even though its a clone it is very fun! You should continue developing it into a full game. I thought of an idea where perhaps you can use that marching cubes background from your main menu instead of hexagons. Or add powerups to slow down time momentarily. I wonder what Super Hexagon would be like in 3D? Congratulations on your game submit geckoo!
  23. 1 point
    A Throwback to the roots of classic first person shooting Think back to a time when military shooters were so dominant and important in your gaming schedule, what made them so good? It's simple, They were fun! No boats, tanks or jets to do your work for you - keep those boots on the ground! You are a soldier, you have your guns, your body and most vitally your mettle! Head out, Grunt! With a distinctly historical arsenal made available to you, you can choose to play any way you want. A selection of the weaponry also contains attachments that were either in use on the field or being tested at the time, giving you lots of options! Unlock more guns as you progress through the ranks to become the ultimate foot-soldier! Come sun, rain or snow in darkness or light, war will rage on! What's the forecast? You choose! You can play in clear, rainy or snowy settings in Grunt1914. These selections have a distinct effect on the maps you choose to fight on, as the visibility and controls adapt to the weather cycle at play! As the fog fills the air and the snow piles will you be able to hold your nerve and take that perfect shot? Time will tell! The Axis vs the Allies, blood will flow! It's the classic story as we've heard it told many times before, the story of brutality and fear, yet also victory and brave hearts! You can play as either a soldier from the Axis alignment, or the Allies confederation. Take up arms in Deathmatch, Team Deathmatch and Gun-Game modes as you rush to be proclaimed the victor above all others! Bordered arenas with tons of tricks and turns Do not desert the battle soldier! Grunt1914 features eight distinct and robust maps to explore and seek triumph in! These are all based on real life locations from novel and peculiar theaters of war of that historical time. Each map features certain unique traits and areas to uncover and unravel, as you make your way through deserts, forests, tombs, military bases, underground hospitals, towns and many more rare areas! Skill above all else There are no power-ups or buffs to help you here, no powers or special treatments to be had. Only one thing matters in Grunt1914, your tactics! How you react and the way you play will decide your fate! There are no vehicles or mounts to save you! Your skill is all you have here! Are you a sniper that favorites long range kills, are you a run and gun heavy grunt or are you sneaky silencer type? You can be any class you want, as long as you can survive! The nostalgia of a classic interface Brave the harsh battlefields and arenas with a compass and map in hand, use those senses to locate enemies on the field! All of these are neatly laid out and visible to you at all times, exactly when and where you will need them! Use these tools to your advantage to turn the tide and become the victor when all seems lost! About the developer Aligned Games© was started by me, Johannes Christiaan Nienaber in 2013 as a video-game development studio. At that time I focused on the creation of smaller scale games, but have since moved into developing bigger and better games. I run the studio myself and as such all of its associated video-game are my sole creations. Grunt1914 is my first foray into the PC gaming market. Please contact me through the studio's website if you have any queries or questions, you can do so at - https://alignedgames.com/ Other social links : Steam : https://store.steampowered.com/app/1059040 Discord : https://discord.gg/Tc5b7D9 Facebook : https://www.facebook.com/Grunt1914/ Twitter : https://twitter.com/grunt1914 IndieDB : https://www.indiedb.com/games/grunt1914 Youtube : https://www.youtube.com/channel/UCKfm34iEuHrFCduvV4OZpag Concept art : Screenshots :
  24. 1 point
    I had a lot of experience modding for Battlefield 2 back in the day, working on some mods. I'm interested to try adapt some of my creations into unity and seem quite encouraged with this community. The online Web demo was amazing. What a cool feature! I I live abroad and playing BF2 is difficult with my friends back home (now the servers are down, it can be buggy). I hope to create a simple but fun and crazy game to play online with my friends that featured the best and crazy parts of my BF2 modding experience. Among my favourites was a shopping trolley vehicle, jetpack and other random things. Nice to meet you all
  25. 1 point
    New demo (0.3.102) download from here New teaser (03):
  26. 1 point
    New Update for Protocol Like and share https://youtu.be/MlKT-FTHfCs
  27. 1 point
  28. 1 point
    Cities skylines who is such a complex and content filled game is also made in unity. Engine doesn't mean anything. I mean look at valve and their source engine games. They all contain closed areas because engine is designed to have rooms, even outside areas are rooms. Then look what Respawn did with source engine. Titanfall 2 is still a stunning game and apex is open just like any unreal engine game. It's all about the developer how they execute the idea. Unity engine has evolved way too much since I started using it. The features they brought are up to standards. And its not from epic games, who are in eyes of whole gaming community for having bad business decisions. And unity ain't owned by tencent.
  29. 1 point
  30. 1 point
    Hello everyone, I think most of you guys who develop android games faced errors with canvas scaling with screen sizes, Like UI elements sometimes out of screen Well, First of all i tried to set a fixed resolution to all screen devices, but some devices uses more memory that it's expected to use which cause a lot of lags, Screen.SetResolution(1080, 2160, true); After a hard work of research i made this script : using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class CanvasTest : MonoBehaviour { public CanvasScaler canvas; void Start() { canvas.referenceResolution.Set(Screen.width, Screen.height); } } The resolution the UI layout is designed for. If the screen resolution is larger, the UI will be scaled up, and if it’s smaller, the UI will be scaled down. i tested it on 4 devices with different screen resolutions and it worked, ------ Tips : -Create a new GameObject in Hierarchy . -Name it what ever you want. -Create a new script like : "CanvasManager." -Drag the code above in the script -put the script in the GameObject -Drag CanvasScaler to the GameObject which contains the script -Make sure the CanvasScaler : 1] UI Scale Mode : Scale with screen size 2] Reference Resolution : as you want but what i tested it was on (1440x2880) 3] Screen Match Mode : Match Width Or Height and make sure it's set to : 1 (width(0)------------(0.5)-----------Height(1)) ------------ It wont work in the Editor(elements collide with each other), test it on android device and it will work fine ------------ if anyone have better than this please post it here Thank you so much!
  31. 1 point
    Maybe it's a joke for the first day of April - or this is a real feature under Unity. I don't know There is a dog as a primitive prefab : https://docs.unity3d.com/Manual/PrimitiveObjects.html#Dog Take a look at the script below ++
  32. 1 point
    If you have 120Hz, or 144Hz monitor, will you play on 60Hz? Limit framerate by setting lower refresh rate? As i understand there are few requirements: 1) vsync should be on 2) fullscreen And because of these requirements players are confused... they set resolution with refresh rate, but refresh rate will not apply (in many cases). It will change to your monitor refresh rate. But most (if not all) games has option to set framerate. And there are other ways to set fremerate limit.
  33. 1 point
    good job man. When you plan to release it ?
  34. 1 point
    Tacoma for free on Humble Bundle : https://www.humblebundle.com/store/tacoma Oxenfree on EpicGames Store : https://www.epicgames.com/store/en-US/product/oxenfree/home
  35. 1 point

    Version 1.6

    3,547 downloads

    Requires unity 5.6.3 or higher. In unity 5 you will have to rebuild the lighting data. In unity 2018.3 you will get MinAttribute error. To fix this error, open MinDrawer script and add following line at the top: using MinAttribute = UnityEngine.PostProcessing.MinAttribute; Also you will have to rebuild the lighting data. *************************** VIDEO TUTORIALS * How to open project: * How to add animated weapon: * How to add weapon by replacing model
  36. 1 point
    Well. I tested a few years ago FPS creator, but respectfully I had disliked it - too slow, not optimized, not really efficient... I hope that this one is well done - more than their previous tool ++
  37. 1 point
    Informations Unity Engine (Version 2017+ Low Poly Fantasy RPG Environment Intuitive package and easy-to-customize Project Documentation Features Unity’s new UI system with Modern Interface Pack Player, Monsters, NPCs Equipment System based on transforms and prefabs Health, thirst and hunger system Point Click, WSAD and Joystick/Controller movement via Navigation Xbox 360 joystick is automatically identified when connecting switching inputs RPG Camera with Zoom, Rotation and Joystick/Controller Support Animations via Mecanim Low Poly FREE 3D Models Minimap Inventory, Loot and Gold System Death and Respawning Carefully crafted C# Code Tottaly FREE to customize Levels and Attributes Day / Night System Download: https://unitylist.com/api/get?id=16426&amp;download
  38. 1 point
    I really like it. It reminds me the first CoD. I would like to see more animation in the video, but you did a great work. HUD is clean. Feelings are good enough - especially this frag at 5'35''++
  39. 1 point
    You did an amazing work. I hope that you can reach your dream - whether creating a commercial game or working on those universes which you like... I wish you the best developing your project. Show us some progress regularly - and have fun ++
  40. 1 point
    Geckoo has a point here. Its got great potential but can get you some trouble lol. If this is nothing more then just a fan project then you can ignore what I'm gonna say next. Just some constructive criticism; It's probably in your best interest to drop the star wars idea. The For Honor inspiration can be justified and I would stick closer to that. Give it the open world that For Honor is missing (I know this is no easy task), build on the inventory system, add some civilians and vendors around the city, and develop a story. Personally I think that's the best use of your potential.
  41. 1 point
    Hey now i try to open project https://armedunity.com/files/file/211-au-fps-kit/ i use: Unity 2017.3.1f1 (64-bit) but i can't find anything i need solved Picture:
  42. 1 point
  43. 1 point
    And where is problem? Open Scenes folder and double click on Testmap scene.
  44. 1 point
    Thank you for your constructive feedback.
  45. 1 point
  46. 1 point
    Hey guys, I'm making a project to waste time, and in this project I'm using ArmedPrefs(made by Erarnitox), but sometimes I just need PlayerPrefs to save things like Resolution, Quality and etc... So I wrote this script to "make it more easier". What are the advantages? 1st - You can load things in two ways now: Ex: DataManager.GetInt("MyInt") Or you can define a "default value" in the final of the function, so if this key do not really exists it will return this value, create and save a new key with the name and the value you used. Ex: DataManager.GetInt("MyInt", 100); // it will return 100, create and save the key if it not exist. 2nd - You can now save and load boolean variables. Ex: DataManager.SetBool("MyBool", true); Ex: DataManager.GetBool("MyBool"); Ex: DataManager.GetBool("MyBool", true); 3rd - Set functions are now saved automatically, so you do not need to use PlayerPrefs.Save(); or DataManager.Save(); 4th - If you want to use this instead PlayerPrefs, you just have to change "PlayerPrefs" to "DataManager". The miracle code This script is very simple, but I hope it can help someone DataManager.cs
  47. 1 point
    many thanks man.. i need an inventory and equip system for my test project that uses fpskit by oma.. do you think i can extrapolate inventory parts and use them to fill my needs?? btw i loved your old fpskit survival version i searched a downlad version for it form ages.. ..hope a day you can redone it with new version in c# and share it ...
  48. 1 point
    I hope you like, any questions let me know. Remembering that it is a free project and do not expect it to be 100% modular, you should understand the concept a bit to use it but it is still easy to customize. =)
  49. 1 point
    Lets Explain the variables: MoveTo - The position of the rotated gun RotateTo - The rotation of the rotated gun Player - Character Controller's GO Layers - Layer to collide with gun Pros: It uses a coroutine to be 10x times faster than in update while using less cpu at the same time If you use a Character Controller: If you use a Capsule Collider of Height 2: Full release of script. It tilts the gun according to your movement.
  50. 1 point
    This script simulates a magnet for particles. How to use: - Create new GameObject and assign script - Assign ParticleSystems and tweak variables using UnityEngine; using System.Collections; public class ParticleMagnet : MonoBehaviour { public ParticleSystem[] particleSystemsToAffect; public float radius = 5; public Vector2 randomForce = new Vector2(0, 100); public float maxSpeed = 10.0f; public void Update() { if (particleSystemsToAffect.Length == 0) if ((particleSystemsToAffect = GameObject.FindObjectsOfType<ParticleSystem>()).Length == 0) return; for (int i = 0; i < particleSystemsToAffect.Length; i++) { ParticleSystem.Particle[] p = new ParticleSystem.Particle[particleSystemsToAffect[i].particleCount]; particleSystemsToAffect[i].GetParticles(p); for (int j = 0; j < p.Length; j++) { float dist = Vector3.Distance(transform.position, p[j].position); if (dist < radius) { Vector3 dir = (transform.position - p[j].position); float finalForce = Mathf.Clamp((dist / radius), 0.0f, 1.0f); p[j].velocity += Vector3.ClampMagnitude(dir * finalForce * Random.Range(randomForce.x, randomForce.y) * Time.fixedDeltaTime, maxSpeed); } } particleSystemsToAffect[i].SetParticles(p, p.Length); } } }
×
×
  • Create New...