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.

V3ndetta

Member
  • Content count

    86
  • Joined

  • Last visited

Community Reputation

7 Neutral

About V3ndetta

  • Rank
    Member
  • Birthday 09/06/1999

Profile Information

  • Gender
    Male
  • Location:
    Europe

Recent Profile Visitors

251 profile views
  1. Any other requirements? Specifics?
  2. Really, this is the wrong forum. Scripts forum is only for posting working scripts you made, and not requests. Head to the Need Help forum instead.
  3. Updates should be presented in 1 topic, and the title only updated. You can post a comment to bump it up to the top, not sure if that's allowed though.
  4. If your animation may not play at first for some reason, in the inspector(on the rectangle with the "Inspector" text) right click and select debug. Next, check is Legacy animation, as I remember this was a big issue for my first few tests as I had no idea wtf was going on.
  5. In C# you need to call a coroutine, and be sure to use a boolean condition which will uncheck at the end of the coroutine, so it won't execute over and over again.
  6. In my game I make use of particle collision, and I must make some more complex models in later stages. Adding the polygon collider2D or dragging the sprite from the project tab over the sprite in the inspector with a collider does not seem to work, as mentioned on Unity official guide. I don't know if this is normal or just another unity bug? If there is no way for the editor to do it, is there any method to calculate the collider by code perhaps? Thanks in advance, a screenshot of my collider: https://www.dropbox.com/s/e4eiiui7xqysem4/Screenshot 2017-01-12 03.07.12.png?dl=0
  7. Maybe for a total newbie this would represent a challange, but for a mediocre or a programmer that may play it just wouldn't be anything at all than plain boring. Since it is one of your game's core mechanics, I think it would be worth making a system with 3 difficulty levels, 1 being the custom language, 2 being one that bonds both together, and 3 just plain printed code.
  8. Looks good, you can also use smaller snow particles, add world collision, and adjust alpha over time, like snow melting on the road.
  9. Why is your question so not in-depth, giving no information, screen shots or otherwise regarding the problem. There are people that can help you, but even I can tell you they will say the same. Why can't you edit the GUI? It won't select? U can't change the elements ? Is it grayed out? Please give us screen shots or some more information.
  10. Welcome to AU.
  11. If the user presses a button that is Unity UI, you can implement(add) actions to them, make 5 functions for example. From a forum" Select the button in your hierarchy, there should be a "Button" component on the inspector. Add a new entry (+ symbol) in the "On Click()"-List. Now you have to drag the GameObject with the attached script into the new entry field (no-object), after that you will be able to select a function which will be called everytime you clicking the button. " That is a really simple and not too practical method, but it will do for you, if you're not looking for something more complex.
  12. Thanks both of you, I just realized that the while loop works like this: Check if statement true If false, create new Object with the given attributes For the created object, you can set tag, or add component right after creating it(face nuke) Loop This makes total sense now! Again, thanks a bunch, must have slipped over this a few months ago when reading about how these execute.
  13. I have started from zero with a procedural tile generator script, and I need to get each GameObject that is untagged after generating the WidthTiles , so I can assign them a tag, so I can group them again by tag and add to each of them a sprite renderer, and in the end give them a random type of tile(later I will implement biome algorhitm or something similar). I tried debugging Line 56 but it does not get detected. What the portion of the code does, is get all game objects without a tag, groups them, and then foreach gameobject Untagged in the group it prints the message. Atleast it should, but I haven't used loops and arrays together before. Could someone point me out? using UnityEngine; using System.Collections; public class GenerateTileMap : MonoBehaviour { public Sprite Empity; public Sprite Dirt; public int GeneratedWidthTiles; public int GeneratedHeightTiles; private int WidthCount=0; private int HeightCount=0; private int NextGenWidthPos=0; private int NextGenHeightPos=0; public bool WorldTilesDone = false; public bool WidthTilesDone = false; public bool HeightTilesDone = false; IEnumerator GenerateWidthTiles() { while (WidthCount < GeneratedWidthTiles) { var Insted = (new GameObject("WidthTile")); WidthCount += 1; if(WidthCount==GeneratedWidthTiles) { WidthTilesDone = true; } yield return null; } } IEnumerator CoordinateWorldTilePositions() { yield return null; } void Start() { StartCoroutine(GenerateWidthTiles()); } void Update() { if (WidthTilesDone) { print("[Debug]Grouping Objects now!"); GameObject[] GroupedWidthTiles; GroupedWidthTiles = GameObject.FindGameObjectsWithTag("Untagged"); foreach(GameObject Untagged in GroupedWidthTiles) { print("Untagged Objects loop working"); Untagged.tag = "WidthTile"; } } } } Thanks in advance.
  14. Gone through all the 30-35 sections showing code and found it, obviously missed it. Well, still got alot to learn, thanks for pointing it out.
  15. So there is a tutotrial I am following on learning to make procedural tile based top down games, and there is a datatype named Tile but I cannot find this anywhere in unity docs nor forums. Can someone explain how comes Tile is recognized as a datatype in his code? using UnityEngine; using System.Collections; using System.Collections.Generic; using Lean; public class TilingEngine : MonoBehaviour { public List<TileSprite> TileSprites; public Vector2 MapSize; public Sprite DefaultImage; public GameObject TileContainerPrefab; public GameObject TilePrefab; public Vector2 CurrentPosition; public Vector2 ViewPortSize; private TileSprite[,] _map; private GameObject controller; private GameObject _tileContainer; private List<GameObject> _tiles = new List<GameObject>(); public void Start() { controller = GameObject.Find("Controller"); _map = new TileSprite[(int)MapSize.x, (int)MapSize.y]; DefaultTiles(); SetTiles(); } private void DefaultTiles() { for (var y = 0; y < MapSize.y - 1; y++) { for (var x = 0; x < MapSize.x - 1; x++) { _map[x, y] = new TileSprite("unset", DefaultImage, Tiles.Unset); } } } private void SetTiles() { var index = 0; for (var y = 0; y < MapSize.y - 1; y++) { for (var x = 0; x < MapSize.x - 1; x++) { _map[x, y] = new TileSprite(TileSprites[index].Name, TileSprites[index].TileImage, TileSprites[index].TileType); index++; if (index > TileSprites.Count - 1) index = 0; } } } private void Update() { AddTilesToWorld(); } private void AddTilesToWorld() { foreach (GameObject o in _tiles) { LeanPool.Despawn(o); } _tiles.Clear(); LeanPool.Despawn(_tileContainer); _tileContainer = LeanPool.Spawn(TileContainerPrefab); var tileSize = .64f; var viewOffsetX = ViewPortSize.x/2f; var viewOffsetY = ViewPortSize.y/2f; for (var y = -viewOffsetY; y < viewOffsetY; y++) { for (var x = -viewOffsetX; x < viewOffsetX; x++) { var tX = x*tileSize; var tY = y*tileSize; var iX = x + CurrentPosition.x; var iY = y + CurrentPosition.y; if (iX < 0) continue; if (iY < 0) continue; if(iX > MapSize.x - 2) continue; if (iY > MapSize.y - 2) continue; var t = LeanPool.Spawn(TilePrefab); t.transform.position = new Vector3(tX, tY, 0); t.transform.SetParent(_tileContainer.transform); var renderer = t.GetComponent<SpriteRenderer>(); renderer.sprite = _map[(int)x + (int)CurrentPosition.x, (int)y + (int)CurrentPosition.y].TileImage; _tiles.Add(t); } } } private TileSprite FindTile(Tiles tile) { foreach (TileSprite tileSprite in TileSprites) { if (tileSprite.TileType == tile) return tileSprite; } return null; } }