Jump to content
  • Advertisement

Search the Community

Showing results for tags 'Unity'.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • GDNet+
  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 1996 results

  1. I am using the rts cam script and was wondering if it was possible to stop the camera from going out of sight of an object. This set up is being developed in unity and is for a 3D game. The camera is being used to rotate, pan and zoom in/around an object. At the moment I can move out of sight of the object. Is there a way to block the camera from going out of sight of the object? I have seen multiple ways to keep an object in sight through the camera, however I am unsure which route to take. I have attached the script being used below. public class RTSCam : MonoBehaviour { private float dist; private float orbitSpeedX; private float orbitSpeedY; private float zoomSpeed; public float rotXSpeedModifier=0.25f; public float rotYSpeedModifier=0.25f; public float zoomSpeedModifier=5; public float minRotX=-20; public float maxRotX=70; //public float minRotY=45; //public float maxRotY=315; public float minZoom=3; public float maxZoom=15; public float panSpeedModifier=1f; // Use this for initialization void Start () { dist=transform.localPosition.z; DemoSceneUI.SetSceneTitle("RTS camera, the camera will orbit around a pivot point but the rotation in z-axis is locked"); string instInfo=""; instInfo+="- swipe or drag on screen to rotate the camera\n"; instInfo+="- pinch or using mouse wheel to zoom in/out\n"; instInfo+="- swipe or drag on screen with 2 fingers to move around\n"; instInfo+="- single finger interaction can be simulate using left mosue button\n"; instInfo+="- two fingers interacion can be simulate using right mouse button"; DemoSceneUI.SetSceneInstruction(instInfo); } void OnEnable(){ IT_Gesture.onDraggingE += OnDragging; IT_Gesture.onMFDraggingE += OnMFDragging; IT_Gesture.onPinchE += OnPinch; orbitSpeedX=0; orbitSpeedY=0; zoomSpeed=0; } void OnDisable(){ IT_Gesture.onDraggingE -= OnDragging; IT_Gesture.onMFDraggingE -= OnMFDragging; IT_Gesture.onPinchE -= OnPinch; } // Update is called once per frame void Update () { //get the current rotation float x=transform.parent.rotation.eulerAngles.x; float y=transform.parent.rotation.eulerAngles.y; //make sure x is between -180 to 180 so we can clamp it propery later if(x>180) x-=360; //calculate the x and y rotation //Quaternion rotationY=Quaternion.Euler(0, Mathf.Clamp(y+orbitSpeedY, minRotY, maxRotY), 0); Quaternion rotationY=Quaternion.Euler(0, y+orbitSpeedY, 0); Quaternion rotationX=Quaternion.Euler(Mathf.Clamp(x+orbitSpeedX, minRotX, maxRotX), 0, 0); //apply the rotation transform.parent.rotation=rotationY*rotationX; //calculate the zoom and apply it dist+=Time.deltaTime*zoomSpeed*0.01f; dist=Mathf.Clamp(dist, -maxZoom, -minZoom); transform.localPosition=new Vector3(0, 0, dist); //reduce all the speed orbitSpeedX*=(1-Time.deltaTime*12); orbitSpeedY*=(1-Time.deltaTime*3); zoomSpeed*=(1-Time.deltaTime*4); //use mouse scroll wheel to simulate pinch, sorry I sort of cheated here zoomSpeed+=Input.GetAxis("Mouse ScrollWheel")*500*zoomSpeedModifier; } //called when one finger drag are detected void OnDragging(DragInfo dragInfo){ //if the drag is perform using mouse2, use it as a two finger drag if(dragInfo.isMouse && dragInfo.index==1) OnMFDragging(dragInfo); //else perform normal orbiting else{ //apply the DPI scaling dragInfo.delta/=IT_Gesture.GetDPIFactor(); //vertical movement is corresponded to rotation in x-axis orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier; //horizontal movement is corresponded to rotation in y-axis orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier; } } //called when pinch is detected void OnPinch(PinchInfo pinfo){ zoomSpeed-=pinfo.magnitude*zoomSpeedModifier/IT_Gesture.GetDPIFactor(); } //called when a dual finger or a right mouse drag is detected void OnMFDragging(DragInfo dragInfo){ //apply the DPI scaling dragInfo.delta/=IT_Gesture.GetDPIFactor(); //make a new direction, pointing horizontally at the direction of the camera y-rotation Quaternion direction=Quaternion.Euler(0, transform.parent.rotation.eulerAngles.y, 0); //calculate forward movement based on vertical input Vector3 moveDirZ=transform.parent.InverseTransformDirection(direction*Vector3.forward*-dragInfo.delta.y); //calculate sideway movement base on horizontal input Vector3 moveDirX=transform.parent.InverseTransformDirection(direction*Vector3.right*-dragInfo.delta.x); //move the cmera transform.parent.Translate(moveDirZ * panSpeedModifier * Time.deltaTime); transform.parent.Translate(moveDirX * panSpeedModifier * Time.deltaTime); } //for the camera to auto rotate and focus on a predefined position /* public float targetRotX; public float targetRotY; public float targetRotZ; public Vector3 targetPos; public float targetZoom; IEnumerator LerpToPoint(){ Quaternion startRot=transform.parent.rotation; Quaternion endRot=Quaternion.Euler(targetRotX, targetRotY, targetRotZ); Vector3 startPos=transform.parent.position; Vector3 startZoom=transform.localPosition; float duration=0; while(duration<1){ transform.parent.rotation=Quaternion.Lerp(startRot, endRot, duration); transform.parent.position=Vector3.Lerp(startPos, targetPos, duration); transform.localPosition=Vector3.Lerp(startZoom, new Vector3(0, 0, -targetZoom), duration); duration+=Time.deltaTime; yield return null; } transform.parent.rotation=endRot; transform.parent.position=targetPos; transform.localPosition=new Vector3(0, 0, -targetZoom); } */ /* private bool instruction=false; void OnGUI(){ string title="RTS camera, the camera will orbit around a pivot point but the rotation in z-axis is locked."; GUI.Label(new Rect(150, 10, 400, 60), title); if(!instruction){ if(GUI.Button(new Rect(10, 55, 130, 35), "Instruction On")){ instruction=true; } } else{ if(GUI.Button(new Rect(10, 55, 130, 35), "Instruction Off")){ instruction=false; } GUI.Box(new Rect(10, 100, 400, 100), ""); string instInfo=""; instInfo+="- swipe or drag on screen to rotate the camera\n"; instInfo+="- pinch or using mouse wheel to zoom in/out\n"; instInfo+="- swipe or drag on screen with 2 fingers to move around\n"; instInfo+="- single finger interaction can be simulate using left mosue button\n"; instInfo+="- two fingers interacion can be simulate using right mouse button"; GUI.Label(new Rect(15, 105, 390, 90), instInfo); } } */ }
  2. Hi, everybody! This is my first official forum post here so I hope this isn't too messy or hard to follow. I might be super duper new at this, but I've got some questions I hope someone might be able to help me with. I've been researching how to create an open world 2D RPG using Unity. My idea has been to hand draw sections of my maps first on paper, then bring them into Photoshop, string them together, and finish painting the areas digitally. I attached a very rough map sketch to this post that I threw a little bit of color and a test sprite on for reference. More than anything I wanted to show that I imagined the map free, more abstract maybe, with the possibility of both "isometric-ish" buildings drawn free-hand and other areas of the map with more verticality. In all my searching I'm still not sure if I've found very many examples of this. Maybe there's very good reason for that, haha. So I'm wondering how realistic is this design? I've read mixed opinions on not using tiles in these types of games, especially if the maps might be big. Is a free-hand design like this too unrealistic for an open world with sprawling maps? Are there key fundamentals that are just going right over my head? How would I go about implementing tiles in my design if that's the most viable option for something like this? I know I'll have to make a lot of compromises in some way, but I don't know which would be the wisest. Thank you so, so much in advance to anyone who might have some answers for me. I hope it wasn't too painful to read, but I really appreciate any guidance you might be able to give me!
  3. I have created a Boolean variable called 3D_pressed and have got the error "error CS1519: Unexpected symbol `3' in class, struct, or interface member declaration". How do I solve this? This is in unity using the the programming language C#.
  4. What is Cloud Assets? Cloud Assets is a simple and lightweight but incredibly effective library that allows you to add dynamic content to your Unity games in all the gaming platforms available, PS4, Xbox One, Steam, Windows Store, iOS, Android and even Nintendo Switch! This is the first and the only library in the Asset Store that supports adding dynamic content simultaneously on consoles, PC and Mobile games. It can be used to: Cross promote your game with Video, Images, or Text Ads. Show news to your gamers dynamically. Display offers, new features, etc How does Cloud Assets work? Cloud Assets it's a Unity library that works with a single JSON file stored in a server to serve text, images and videos to use in your projects. You can change the content of your game without having to update the binary. You just need to change the references to the assets in the JSON file in seconds, and your game content will be updated. What are the features that make Cloud Assets the unique library in the Asset Store? Use it on any game platform (PS4, Xbox One, Nintendo Switch, Steam, Windows Store, iOS and Android) Display text, image and/or video wherever you want inside your game. Open external links in the platform web browser or the device store (mobile, consoles and PC) Works with a simple JSON file stored in a server. You don't need to be a programmer! Just change the URL which redirects to your games and adds the text, image and/or video that matches your needs. Use tags to quickly identify your assets and replace them easily. You can add title, description and URL in the text asset. Useful links about the library: - Unity Asset Store: https://www.assetstore.unity3d.com/#!/content/116697 - Game Troopers Website: http://gametroopers.net/ - Cloud Assets Tutorials: https://www.youtube.com/playlist?list=PLkZtvv5GUSSUVWeVhRJ1tb3MaoZV7ILWP
  5. What is Cloud Assets? Cloud Assets is a simple and lightweight but incredibly effective library that allows you to add dynamic content to your Unity games in all the gaming platforms available, PS4, Xbox One, Steam, Windows Store, iOS, Android and even Nintendo Switch! This is the first and the only library in the Asset Store that supports adding dynamic content simultaneously on consoles, PC and Mobile games. It can be used to: Cross promote your game with Video, Images, or Text Ads. Show news to your gamers dynamically. Display offers, new features, etc How does Cloud Assets work? Cloud Assets it's a Unity library that works with a single JSON file stored in a server to serve text, images and videos to use in your projects. You can change the content of your game without having to update the binary. You just need to change the references to the assets in the JSON file in seconds, and your game content will be updated. What are the features that make Cloud Assets the unique library in the Asset Store? Use it on any game platform (PS4, Xbox One, Nintendo Switch, Steam, Windows Store, iOS and Android) Display text, image and/or video wherever you want inside your game. Open external links in the platform web browser or the device store (mobile, consoles and PC) Works with a simple JSON file stored in a server. You don't need to be a programmer! Just change the URL which redirects to your games and adds the text, image and/or video that matches your needs. Use tags to quickly identify your assets and replace them easily. You can add title, description and URL in the text asset. Useful links about the library: - Unity Asset Store: https://www.assetstore.unity3d.com/#!/content/116697 - Game Troopers Website: http://gametroopers.net/ - Cloud Assets Tutorials: https://www.youtube.com/playlist?list=PLkZtvv5GUSSUVWeVhRJ1tb3MaoZV7ILWP View full story
  6. I have tried a few brick material assets from the unity asset store but none of them seem to actually work. I am trying to add a brick material to a 3D mesh. The assets I have used so far would be as follows; brick walls package and brick 1 - materials. Does anyone know of brick materials for unity?
  7. For two days I have been struggling with trying to draw a image on a plane at the exact point. I have a UV point, however because of how the shaders work, or at least my understanding of it, I the piece of code only effects the current pixel. So I can easily draw gradients, change the color of the pixel at that UV point and all kinds of effects. However the only way I could think of drawing the image was to calculate the four corners from the center point, except after I found these points using 4 "If" branches I have no idea on how to use these points to draw the images. The shader is just a basic shadless vertex and fragment shader. Unlit.
  8. Ooohhhh boy. I'm back with more questions. I am having a horrible time with this pick up I'm working on. I've got multiple issues but I'm trying to make a list and work through them one by one. If you haven't already seen one of my other posts, I'm working on an arkanoid clone type game, with a pickup that when active, the ball will come back and hit the paddle, and as it leave the paddle, 6 additional balls should be spawned, with a short delay between each one, and then they all follow the first ball in a straight line away from the paddle until they all hit whatever is in front of them. Each ball is destroyed on impact except for the last ball in the line. So, onto my problem: Currently, the original ball hits the paddle and bounces away fine, and another ball is spawned. However, this ball is not spawned over the paddle like it should be. Some times it spawns right next to the paddle, sometimes it spawns half way across the screen. Left or right of the paddle, either way. Can't seem to find any rhyme or reason to it's spawn location. I have added code directly to this ball so that right after it is spawned, it's location should be initialized in a location over the paddle. I used the same code that I use on the original ball at the beginning of the game. Also, when this ball spawns, it falls. I thought I had it set so that the vector of the original ball would be assigned to this new ball and it would just move in the same direction as it, but apparently I'm missing something there. I'll post all my code for this pick up and also for the Ball class and maybe someone can explain what I'm doing wrong. This pickup is really making me lose my mind! AssaultRiflePickUp class: public class AssaultRiflePickUp : BasePickUp, ISpecialShotPickUp { private int AmmoRemaining = 35; private float timer = 0.3f; private Vector3 mainBallVector; public GameObject newBall; void Start () { //assign paddle to variable paddle = GameObject.FindObjectOfType<Paddle> (); //find the ball and assign it to this variable foreach (Ball ball in GameManager.pickUpManager.allBalls) { if (ball.mainBall) { mainBall = ball; } } } public override void ActivatePickUp (MonoBehaviour coroutineHost) { Debug.Log("ActivatePickUp"); //subscribe to events mainBall.onBallHitPaddle += AssaultRifleShot; mainBall.onBallCollided += DestroyExtraBalls; } public void SpecialShot () //spawn a new ball. add it to the list of balls. set it's spawn location, set it's velocity to match the original ball { Debug.Log("SpecialShot"); Instantiate(newBall); newBall.GetComponent<Ball>().hasStarted = true; GameManager.pickUpManager.allBalls.Add(newBall.GetComponent<Ball>()); newBall.GetComponent<Ball>().paddleToBallVector = newBall.transform.position - paddle.transform.position; newBall.transform.position = paddle.transform.position + newBall.GetComponent<Ball>().paddleToBallVector; //use the original ball's vector3 to follow it directly newBall.GetComponent<Rigidbody2D>().velocity = mainBallVector; } public void DestroyExtraBalls (GameObject ball) { if (GameManager.pickUpManager.allBalls.Count > 1) { } //TODO: Implement observer pattern to watch for balls colliding with something. If they do and they are not the main ball, destroy them. } public void DestroyPickUp () { Debug.Log("DestroyPickUp"); Destroy (GameManager.pickUpManager.pickUpQueue [0]); GameManager.pickUpManager.pickUpQueue.RemoveAt (0); GameManager.pickUpManager.pickUpActive = false; } //a timer used for timed pick ups public IEnumerator PowerUpTimer (float delay) { Debug.Log("PowerUpTimer"); yield return new WaitForSeconds (delay); SpecialShot(); } //The coroutine is used to start a short timer so that the balls don't spawn on top of each other all at the same time. public void StartCoroutine (float delay, MonoBehaviour coroutineHost) { coroutineHost.StartCoroutine(PowerUpTimer(delay)); } //Controls the pick up's cycle public void AssaultRifleShot (GameObject mainBall) { Debug.Log("AssaultRifleShot called"); mainBallVector = mainBall.GetComponent<Rigidbody2D>().velocity; //grab mainBall's direction and speed before making it a destroyable ball mainBall.GetComponent<Ball>().mainBall = false; //deactivate the original ball as the mainBall so that it may be destroyed on impact if (AmmoRemaining > 0) { Debug.Log("AssaultRifleShot - Inside If Statement"); //if there is ammo remaining, set the main ball to just a normal ball so it can be destroyed on impact and then start coroutine mainBall.GetComponent<Ball> ().mainBall = false; Debug.Log("AssaultRifleShot - 1"); mainBall.GetComponent<Ball> ().onBallHitPaddle -= AssaultRifleShot; //unsubscribe to event when mainBall is set to false. Debug.Log("AssaultRifleShot - 2"); StartCoroutine(timer, GameManager.monoBehaviour); Debug.Log("AssaultRifleShot - 3"); AmmoRemaining -= 1; Debug.Log("AssaultRifleShot - 4"); } else { DestroyPickUp(); } } } Side note: There is some base class code for the pick up, if it is decided that that is needed as well I can post it. But I don't think it's relevant. Ball class: public class Ball : MonoBehaviour { private Paddle paddle; public Vector3 paddleToBallVector; public bool mainBall = false; public float Speed { get; set; } public float MaxSpeed = 10.198f; public bool hasStarted = false; public delegate void DestroyBalls(GameObject ball); public event DestroyBalls onBallCollided; public delegate void BallHitPaddle(GameObject ball); public event BallHitPaddle onBallHitPaddle; void Start () { //find the paddle and assign it to variable paddle = GameObject.FindObjectOfType<Paddle> (); paddleToBallVector = this.transform.position - paddle.transform.position; Speed = 1; } // Update is called once per frame void Update () { if (!hasStarted) { //Lock the ball relative to the paddle. this.transform.position = paddle.transform.position + paddleToBallVector; //Wait for a mouse press to launch. if (Input.GetMouseButtonDown (0)) { hasStarted = true; this.GetComponent<Rigidbody2D> ().velocity = new Vector2 (2f, 10f); } } } void OnCollisionEnter2D (Collision2D collider) { //use this vector2 to adjust the velocity so the ball does not get stuck in a vertical bouncing loop if (hasStarted) { //apply sound when the ball hits something AudioSource audio = this.gameObject.GetComponent<AudioSource> (); audio.Play (); Vector2 tweak = new Vector2 (UnityEngine.Random.Range (0f, 0.2f), UnityEngine.Random.Range (0f, 0.2f)); //the following lines set the speed and direction of the ball based on built in physics, and the current speed of the ball. Speed can be changed based on pick ups this.gameObject.GetComponent<Rigidbody2D> ().velocity = this.gameObject.GetComponent<Rigidbody2D> ().velocity.normalized; this.gameObject.GetComponent<Rigidbody2D> ().velocity *= Speed * MaxSpeed; this.gameObject.GetComponent<Rigidbody2D> ().velocity += tweak; if (collider.gameObject.name == "Paddle" && this.mainBall) { if (onBallHitPaddle != null) { onBallHitPaddle (this.gameObject); } } } } }
  9. I've got a bit of a weird setup here so to explain real briefly, I have pickups that when hit, the game object is destroyed, but the script of the object is cloned and put into a list. This is so my pick up queue knows which pick ups we have collected, and which one to activate next. This is the error I'm getting: NullReferenceException: Object reference not set to an instance of an object AssaultRiflePickUp.StartCoroutine (Single delay, UnityEngine.MonoBehaviour coroutineHost) (at Assets/Scripts/AssaultRiflePickUp.cs:76) AssaultRiflePickUp.AssaultRifleShot (UnityEngine.GameObject mainBall) (at Assets/Scripts/AssaultRiflePickUp.cs:93) Ball.OnCollisionEnter2D (UnityEngine.Collision2D collider) (at Assets/Scripts/Ball.cs:63) And I've put several debug.Log messages to narrow down exactly when it is throwing the error, in the following code, it is thrown right after AssaultRifleShot - 2, but before AssaultRifleShot - 3, so basically it's something to do with my coroutine I believe. Hopefully someone can help me figure out what is going on with it because I'm confused how it can say null exception when it's already calling a method from the object. Here is the code: using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Threading; public class AssaultRiflePickUp : BasePickUp, ISpecialShotPickUp { private int AmmoRemaining = 35; private float timer = 0.3f; public GameObject newBall; void Start () { //assign paddle to variable paddle = GameObject.FindObjectOfType<Paddle> (); //find the ball and assign it to this variable foreach (Ball ball in GameManager.pickUpManager.allBalls) { if (ball.mainBall) { mainBall = ball; } } } public override void ActivatePickUp (MonoBehaviour coroutineHost) { Debug.Log("ActivatePickUp"); //subscribe to events mainBall.onBallHitPaddle += AssaultRifleShot; mainBall.onBallCollided += DestroyExtraBalls; } public void SpecialShot () { Debug.Log("SpecialShot"); Vector3 mainBallVector = mainBall.GetComponent<Rigidbody2D>().velocity; //grab mainBall's direction and speed before making it a destroyable ball mainBall.GetComponent<Ball>().mainBall = false; Instantiate(newBall); GameManager.pickUpManager.allBalls.Add(newBall.GetComponent<Ball>()); newBall.transform.position = paddle.transform.position + ballSpawnOffset; //use the original ball's vector3 to follow it directly newBall.GetComponent<Rigidbody2D>().velocity = mainBallVector; } public void DestroyExtraBalls (GameObject ball) { if (GameManager.pickUpManager.allBalls.Count > 1) { } //TODO: Implement observer pattern to watch for balls colliding with something. If they do and they are not the main ball, destroy them. } public void DestroyPickUp () { Debug.Log("DestroyPickUp"); Destroy (GameManager.pickUpManager.pickUpQueue [0]); GameManager.pickUpManager.pickUpQueue.RemoveAt (0); GameManager.pickUpManager.pickUpActive = false; } //a timer used for timed pick ups public IEnumerator PowerUpTimer (float delay) { Debug.Log("PowerUpTimer"); yield return new WaitForSeconds (delay); SpecialShot(); } //The coroutine is used to start a short timer so that the balls don't spawn on top of each other all at the same time. public void StartCoroutine (float delay, MonoBehaviour coroutineHost) { coroutineHost.StartCoroutine(PowerUpTimer(delay)); } //Controls the pick up's cycle public void AssaultRifleShot (GameObject mainBall) { Debug.Log("AssaultRifleShot called"); if (AmmoRemaining > 0) { Debug.Log("AssaultRifleShot - Inside If Statement"); //if there is ammo remaining, set the main ball to just a normal ball so it can be destroyed on impact and then start coroutine mainBall.GetComponent<Ball> ().mainBall = false; Debug.Log("AssaultRifleShot - 1"); mainBall.GetComponent<Ball> ().onBallHitPaddle -= AssaultRifleShot; //unsubscribe to event when mainBall is set to false. Debug.Log("AssaultRifleShot - 2"); StartCoroutine(timer, GameManager.monoBehaviour); Debug.Log("AssaultRifleShot - 3"); AmmoRemaining -= 1; Debug.Log("AssaultRifleShot - 4"); } else { DestroyPickUp(); } } } I'll post the cloning code here just in case it has anything to do with it. Maybe I'm not cloning it correctly? But it's working for my other pick ups, which also use coroutines. public object Clone () { //clone the pick up object to prevent a null reference when the pick up game object is destroyed BasePickUp newPickUp = (BasePickUp)this.MemberwiseClone(); return newPickUp; }
  10. Hello, We are the small team ,which searching for coder in unity C#. Because ,we need free hands to our project. Project genre is space sim 2d.Sems like Freelancer or Space Impossible.You can be in sandbox or you can complite missions.We had made sems like 50-60% of prototype ,which we will send to itch.io . More info in our discord . Payments:revshare The end of project:early 2019 If you interested team Discord: https://discord.gg/f3dXzFn Write to Scoutrooper.
  11. Ahoy Captains! Just a quick recap over what we have spent our time on this last month! One of the very active 3D artist who also does historical reconstruction in 3D has made an amazing merchants pistol in two variants for us, it has been rigged and we are now soon thinking of starting the animation of this beauty! This artist also bought himself a sail boat the other day, he is a proper Captain now, congrats! We have also spent some time on streams, fixing issues on the ship. So if you would like to follow that progress, you can do so here www.twitch.tv/trym_studios Meanwhile I have been diving into the texture issues, Dibble has been working on our inventory and dialog prototype to get that ready and to our liking. VFX We have also worked on the VFX for the cannons for "The Dawn" as well as the hit effect when you defend yourself. Animations As in the previous update, we are redoing and adding some new animations. We felt some of the updates needed a better touch and feel to it as well. Want more info, you can always check out www.seasoffortune.com Now to another important part, summer vacations are coming up so for our backers, the next community build will probably be in beginning or mid September. There will be a change in the build in regards of the overall lighting and waves + some more goodies. Looking forward to the feedback for that. However, to get the project going a bit faster, we are also looking for people to help out on the project, so if you have some C# and unity experience, please reach out if you find the project interesting at contact@seasoffortune.com OHHHH and we starting working the pirate NPC ship. A few updates down we will share some progress of that one! All the best, and have a great summer!! - Captain Tommy
  12. In previous log I could get some wood, now I can mine rocks. When holding a pickaxe, any rock can be mined into smaller stones. Different size of rock will give the player different sizes of stones - large, medium, small and diffenert amount. When mining is finished the rock will fall apart into several pieces which can the player pick up. Later I will add some minerals which will fall apart into mineral ores and stones. Like wood, stones can be sold, further processed into stone blocks used for trading and for crafting. Mineral ores can be sold, or melted into bars and then used for trading or crafting. Amount of carried stones and woods will depend on character attributes and skills. As usually, there is demo of rock mining. Again don't mind my silly mining animation mining.webm Removing stones from inventory is now limited. Removing whole stack of stones causes big stoney explosion because all stones are after removing at one position and after enabling their physics they are like magnets repeling each other with enormous force, not sure how to avoid it (maybe time delay of each stone removal?)... As you could notice my flora gone wild. I used Prefab painter asset from Unity asset store for few €, to apply my flora models, which are not pickable yet, but will be soon. Please visit my Altos facebook page or devlog website. See you in next log. Darthy.
  13. To gather some wood you will have to cut down a tree (hatchet or axe required, do'h), cut trunk into chunks and then pick it up. From every trunk you get branches and logs. Each kind of tree or growth stage of the tree has different time needed to bring it down (also skill and an axe/hatchet type will affect the cutting time), also an amount of wood differentiate with size (resp. growth stage) and tree type and aspects as market price will depend on wood type. There will be areas and forests with rare/very rare trees, which wood will be much more valuable but also such areas will be difficult to reach. Wood will be used for trading, further processing into planks (from logs) used for trading, or tools/weapons crafting. I am working on some king of "flora AI" where forests will keep themselves "alive", meaning that if number of trees will decrease, a forest automatically will seed new trees, which will slowly grow. Growth time will differ for tree types, growth speed will be adjusted later in balancing phase of development. Here is a small demo of tree cutting. Please don't judge my silly cutting animation (or do, but only with constructive criticism) gathering_wood.webm Physics will need a bit tweaking later, because sometimes trunk don't want to fall down, even when my colliders aren't flat on impact surfaces. The "row" looking thing when trunk is splitted is fixed now by adding some random rotation when instantianting models. Please visit my Altos facebook page or devlog website. See you in next log. Darthy.
  14. How to get the selected scene's triangles in code in menuitem?
  15. Unity® software is one of the most popular options for beginning and established indie developers. With a great feature set and range of target platforms it’s a very attractive choice. The popularity of Unity® software is in no small part thanks to a very liberal free license tier which allows developers grossing less than $100k annual revenue to use the fully featured engine at no cost. While it’s reasonable to expect that Unity Technologies would try to attract developers on the free tier to upgrade to a Unity Plus or Unity Pro license, it would seem some developers have been the subject of dishonest hard sale tactics and even some coercion. We’ve spoken to several developers, and it seems there is a pattern to these aggressive sales tactics beginning with a message like the following: Nothing is particularly amiss here. The message is polite, not overly pushy, and simply invites discussion of an upgrade. Unfortunately, however, it seems this “cold call” style message is a little dishonest. Several of the developers we have spoken to have received this message despite no mention of their project on LinkedIn, and at least two are not even registered on the platform. The above message has then been followed up with a message suggesting developers are in violation of Unity® software licensing terms due to a higher revenue than the allowed $100k. Now, these aren’t big-name developers with highly successful projects receiving the messages. Some trivial investigation of the developers’ social accounts or websites would reveal they have not earned anywhere close to the limit. One developer Tweeted: Mike Berg of We Heart Games (who kindly provided the above images) had the following to say: At the time of writing, Unity Technologies has not responded to our request for comments, but have been in contact with some of the affected developers. Mike Berg has kindly shared part of his exchange, which you can view in full on Twitter, and we have included part of here: Hopefully, the follow up from Unity Technologies and reduction of automated processes prevents similar incidents from happening in future, though in at least some cases it seems it’s too late to win back customers who have received the messages and are now considering alternative options. The Unity logo and Unity product names are the property of Unity Technologies. View full story
  16. Hope rises as pieces of the overworld are coming together. Weighed down by post-delay sad vibes all week and only just now getting back into the swing of things as I write this at 3:30am on a Wednesday. This week was code fever and I wore a programmer cap tight while sprucing up BGP's bones. Lots of things are working better than ever, and lots more are sure to come. The real issue right now is seeing how much can get up and running before BronyCon. The panel is going to be a slideshow about game development in general, some Q&A between slides, how I came up with and created BGP, and what features I have left to create and how I plan to implement them. And all that will be sandwiched between a Trailer to show off the game and a gameplay demo of the battle system and overworld. Then I'd like to have some sort of teaser finale to send everyone off with and encourage them to download the demo to their phones on the way out so they can remember the game later. But how much I can show depends on how far I get in the next 6 days, so fingers crossed, I won't hit any more road blocks. Every precious minute counts right now, and I think I might just barely make it. So let's see what's been done in the past few days.Read More: yotesgames.com
  17. His Majesty, the PrefabI must admit that i’ve been a bit what you could call ‘lazy’ for the past few months. Why is lazy hyphenated? Well, because i’m not really lazy, i just tried to finish a game from 0 knowledge of Unity in under two years, which is not an easy task. I spent a lot of sleepless nights working, had a few burnouts, but one thing ultimately slowed down my progress to almost halt. When i finished most of the mechanics for the game and got to the most important part – making content – i simply couldn’t find any more willpower because of the tedious process involved in making hundreds of enemy waves. I believe someone with better coding skills could make a level editor and finish it much quicker, but with my knowledge, i had to do everything by hand and i kind of lost the motivation. Let’s delve a bit deeper into the problem. One of the things i really love about Unity is use of Prefabs. As someone who is not a programmer by trade, it was easy for me to relate to something drag and droppable, an object with belonging properties that is simple to instantiate and easy to manipulate without much hassle. Two years ago, one of my first questions on Unity Forums was about something that i didn’t even know what is called back then – Nested Prefabs. I couldn’t understand why instantiated objects could have child objects that have child objects who also have child objects can exist in the scene, but not as a Prefab. That pretty much broke my building blocks concept of making a game. Harsh red line reality checkAs you can see, i imagined the waves of enemies to be compiled of squadrons (as well as waypoint and single enemies, about which i wrote in my previous logs) which would be a Prefab object with lots of children objects (singular ships and their engine jets, weapon, tags for missile homing and so on). Unfortunately, Unity supports only one level of vertical nesting in the project, so while an object can have literally hundreds of children, non of them can have their own. Since i read that the Nested Prefabs are something that was planned more than five years ago and not yet in the making i tried a few assets that simulate Nested Prefabs but to no avail. You’ve probably seen the horrible reviews on the Asset Store, most of them are abandoned, buggy, slow or complicated. Since i found no decent asset that will enable me to work the way i imagined, i resorted to the usual workflow of instantiating a Prefab and populating it with components that i needed. The usual get this/set this workflowIt wasn’t too hard for single enemies, all i needed to do was instantiate appropriate objects on designated locations and that’s it. I learned a lot of things in the process, getting and setting the properties of many available components and their variables, the importance of pooling and the way it works, managing performance and so on. I must admit i had more than a handful of situations where i didn’t know how to overcome some of the challenges, but i’m grateful for them since they were an opportunity to learn something new through problem solving. When most of the stuff that make the core of the games look and feel were finished, the harder part of making a game in the true sense of words came. I won’t repeat myself too much, you can read more about my process of making waves in this and this log. In short, instead of dragging and dropping positions where i want the ships to spawn, assign the wanted behavior to each one depending on the wave structure and simply save all that as a prefab i need to: Have specific spawner types. That means single enemy, waypoint enemy and squadron enemy spawner with their locations. Make a specialized movement FSM’s for almost every enemy type that will dictate movement direction and scale of ships and ships’ children. For example, engine jet needs to be a separate object so it doesn’t flash with the ship upon bullet contact but it must be properly rotated and scaled depending on the spawning position and spawner parent of the parent (yeah, even i lost it while reading). Assign more elements to pool which slows down the compilation time and time required to start the game. Instead of pooling one ship with all the needed components i need to pool the ship prefab, jet prefab, weapon prefaband in some cases multiple weapon prefabs so the pool size for ships is actually at least three times the size in terms of object number. I’m fairly certain that it’s better to have fewer objects to instantiate regardless of their complexity (number of components attached). Manually set the spawning position of each ship in the wave. This is the worst part, it got me completely devastated. I need spawners for assigning some general behaviors and general screen position, but all the fine arrangement of ships in the wave must be done by hand. Not completely, but i need to put the ships in the scene so i can get their coordinates, then copy them into the spawning FSM of the squadron. Sure, i need to position the ships with nested prefabs too, but only once and that’s it. Doesn’t sound like much of a fuss, but imagine having hundreds of waves to make with some of them having double digit number of enemies that need to be repositioned upon spawning. Set Position, Set Position, Set PositionI’m sure some people don’t even use prefabs but create instances and populate them on runtime and i presume some more C#-savvy people will find nothing unusual in this and develop their own systems for handling the situation, especially big teams. But i’m neither of those and, for the time being, i really need nested prefabs to finish what i’ve started. Prefabs are great game building blocks that further upgrade great tool that Unity already is and we should be really glad they are taking into account the needs of small or one man teams. I’m anxious to see further improvements that the new prefab system will bring to the table in the future versions. The post Ode to Nested Prefabs from a noob indie dev appeared first on Fat Pug Studio. View the full article
  18. Unity® software is one of the most popular options for beginning and established indie developers. With a great feature set and range of target platforms it’s a very attractive choice. The popularity of Unity® software is in no small part thanks to a very liberal free license tier which allows developers grossing less than $100k annual revenue to use the fully featured engine at no cost. While it’s reasonable to expect that Unity Technologies would try to attract developers on the free tier to upgrade to a Unity Plus or Unity Pro license, it would seem some developers have been the subject of dishonest hard sale tactics and even some coercion. We’ve spoken to several developers, and it seems there is a pattern to these aggressive sales tactics beginning with a message like the following: Nothing is particularly amiss here. The message is polite, not overly pushy, and simply invites discussion of an upgrade. Unfortunately, however, it seems this “cold call” style message is a little dishonest. Several of the developers we have spoken to have received this message despite no mention of their project on LinkedIn, and at least two are not even registered on the platform. The above message has then been followed up with a message suggesting developers are in violation of Unity® software licensing terms due to a higher revenue than the allowed $100k. Now, these aren’t big-name developers with highly successful projects receiving the messages. Some trivial investigation of the developers’ social accounts or websites would reveal they have not earned anywhere close to the limit. One developer Tweeted: Mike Berg of We Heart Games (who kindly provided the above images) had the following to say: At the time of writing, Unity Technologies has not responded to our request for comments, but have been in contact with some of the affected developers. Mike Berg has kindly shared part of his exchange, which you can view in full on Twitter, and we have included part of here: Hopefully, the follow up from Unity Technologies and reduction of automated processes prevents similar incidents from happening in future, though in at least some cases it seems it’s too late to win back customers who have received the messages and are now considering alternative options. The Unity logo and Unity product names are the property of Unity Technologies.
  19. Hey guys, I am looking for a hobby project to get back into game programming. I havent worked on any games in a couple years due to a career change (not saying I was a professional) but I have the free time now to refresh my skills. My experience is with 2D 16bit style games and I'd prefer to work on something of that nature but I'm not opposed to learning something completely new, I just enjoy that game style. It takes me back to the good ol' days haha. Feel free to email me at mrposotive@gmail.com
  20. Hello! Well, as the title suggests, I'm looking for some people to join me in an adventure to make a good game. And so, it'd be cool if someone were to join, doesn't matter if you have experience, doesn't matter if you're a programmer, a level designer or whatever. I'll be glad if you lend me a hand. Some background for the project: - Yes, it is in Unity. - No, it is not a "fantasy online JRPG with survival elements and Battle Royale mode" type of game, chill, it is sigle player, story-driven game, maybe exploring a little, but...well, if you join you'll know more. - It is in first person, no need for a "main characher model" or animations. - It's just a side project to learn and let our names be known. So, yeah, if you're interested, just send me a msg in Discord or here... I guess. - Discord: Emile#5489
  21. I have been doing research into whether the arkit sdk can be used to build to android in unity? I can't seem to find a conlcusive answer yet. I am curious to find out because googles arcore sdk can be built to ios so I was wondering if the arkit plugin could be used on android devices.
  22. Hello everybody! I'm producer manager at HoloForge Entertainment. We are creating a corporation of MMORPGS creation that will suit on Android, ios, pc and Microsoft HoloLens VR glasses. We are just creating our first game called Greater power, a medieval fantasy TCG MMORPG. We would like to know if there are anyone interested to be part of the project! We principally search 3D artists and UI/graphics designers! As we didn't create Corp officially yet, we can't guarantee wages yet until corporation official creation but depending on contribution, people will get shares in addition of their wages when the corp is launched ! If anyone interested, don't hesitate to contact me! http://holoforge.wixsite.com/greaterpowers
  23. Hello everyone, We are developers from Belgium and Panama. After 4 years of development, we just released our game Apocalypse Hunters. It’s a mix of Pokemon Go and Clash Royale with weather forecast interaction. As you may imagine it was a development road full of adventures. We had to go from 2D to 3D, redo some works because the plugin we had been using were out of date or the company making them closed, we also needed to add the multiplayer. Finally, we had to change game mechanisms to counter strategies of some smart cards ‘players. Now, we would love to invite you to try it HERE and please share your feedback so that we can keep improving it
  24. The Unity 2018 update looked like a good move forward to me, but apparently I am one of the few that thinks so. Talking to colleagues today I learned that a lot of them are considering abandoning Unity because it is dropping the light Monodevelop for the heavy Visual Studio Community. Many of them are, like me, hobby developers and apparently just aren't willing to struggle with visual studio. At first I didn't understand the complaints, then it was pointed out to me that visual studio is around 1.5GB to download. Making it as big as the whole Unity engine, when most of these small developers just want it to make small scripts. Of course I mentioned VS Code, however it was easily countered because VS Code isn't really supported by Unity. What do the developers of GameDev think about Unity's move to Visual Studio?
  25. For one of the upcoming projects (which will follow in some of the following posts), and as it had to fit the lore of the game, a black hole was necessary. Before going forward - let me add an image of what result I want to achieve: Artist conception of black hole - NASA/JPL-Caltech While the image is similar to the final effect I wanted to achieve, I did some changes on the effect to be more colorful and bright - but the original idea was from this image. The effect is actually separated in 3 major parts - Disk, Streaks and Post processing.Of course there is also the core of the black hole (which is just a small sphere, with black color). Disk The disk around black hole is actually just matter that rotates around the core. Depending on the distance from the core the average density will increase near the event horizon and decrease further from it. Near the core the density can be so high that it may eventually have temperature close to star - therefore there might be high emissive energy - and therefore light. Also, due to the time dilation (and therefore light having hard time escaping near the event horizon), the emissivity is getting lower very close near the event horizon. Anything beyond event horizon is invisible from the outside, because gravity there is so strong, not even photons can escape. At least that is what I understand from the topic from physics point of view. This actually explained what can be seen on the image and what is going on graphically, that is: The disk rotates around the core The density of disk decreases further from the core The emissive light decreases further from the core, and therefore some (outer) parts of the disk will be lit by inner part ... although inner part around the core has to be somehow darker Which can be solved with simple texturing and some basic lighting of the result. Using whirl-like texture as a basis proved to be a good start for me. I started off by creating a whirl-like texture that would define density in various parts of the disk, which resulted in this: Generating a normal map for lighting from this is actually quite straight forward (and easy in Substance Designer F.e.) - and after short time, I also had a normal map: Putting just these together with basic diffuse lighting (standard N.L) from the center (slightly above the plane) gives us some basic results: Next thing is defining emissivity. This is done simply by using 1D gradient texture for which the coordinate will be distance from the center. The gradient I came up with is: Notice the left part - which is near the event horizon.will give us similar feeling to the image as we're not jumping straight to bright value. Applying emissive value (as both - multiplier for the color, and as emission) gives us this look: Which looks good enough already - I personally played a bit with values (mainly playing with contrast and other multiplication factors - F.e. for alpha channel/transparency), and ended up with this result: Resulting pixel shader is as simple as: fixed4 frag (v2f i) : SV_Target { // Calculate texture coordinate for gradient float2 centric = i.uv * 2.0f - 1.0f; float dist = min(sqrt(centric.x * centric.x + centric.y * centric.y), 1.0f); // Lookup gradient float3 gradient = tex2D(_GradientTex, float2(dist, 0.0f)).xyz; // Light direction (hack - simulates light approx. in the middle, slightly pushed up) float3 lightDir = normalize(float3(centric.x, -centric.y, -0.5f)); // Use normals from normal map float3 normals = normalize(tex2D(_NormalsTex, i.uv).xyz * 2.0f - 1.0f); // Simple N.L is enough for lighting float bump = max(dot(-lightDir, normals), 0.0f); // Alpha texture float alpha = tex2D(_AlphaTex, i.uv).x; // Mix colors (note. contrast increase required for both - lighting and alpha) return fixed4((gradient * bump * bump * bump + gradient) * 0.75f, min(alpha * alpha * 6.0f, 1.0f)); } Streaks There are 2 streaks, directing upwards and downwards from the core. My intention was to make them bright compared to the core and blue-ish - to keep the background more colorful in the end. Each streak is composed from 2 objects, a very bright white sphere (which will take advantage of used post processing effects to feel bright), and a geometry for the streaks (instead of using particles). The geometry is quite simple - looks a bit like rotated and cut hyperbole, notice the UV map on the left (it is important for understanding the next part): This geometry is there 4 times for each direction of the streak, rotated around the origin by 90, 180 and 270 degrees. The actual idea for streaks was simple - have a simple geometry of cut surface, and roll a texture over it. Multiplying with correct color and distance from the beginning of the streak adds color effect that nicely fades into the background. To create a particles-like texture that varies in intensity I used Substance Designer again and come up with: By simply applying this texture as alpha, and moving the X-texture coordinate the streak is animated, like: Multiplying by wanted color gives us: And multiplying by factor given by distance from the origin of the streak results in: Which is actually quite acceptable for me. For the sake of completeness, here is the full pixel shader: fixed4 frag (v2f i) : SV_Target { // Texture coordinates, offset based on external value (animates streaks) float2 uv = i.uv.xy + float2(_Offset, 0.0f); // Alpha texture for streaks fixed alpha = tex2D(_AlphaTex, uv); // Distance from origin factor (calculated from texture coordinates of streaks) float factor = pow(1.0f - i.uv.x, 4.0f); // Multiplication factor (to 'overbright' the effect - so that it 'blooms properly' when applying post-process) float exposure = 6.0f; // Apply resulting color return fixed4(exposure * 51.0 / 255.0, exposure * 110.0 / 255.0, exposure * 150.0 / 255.0, alpha * factor); } Putting the effects together ends up in: Post Processing By using simple bloom effect, we can achieve the resulting final effect as shown in video, which improves this kind of effect a lot. I've added lens dirt texture to bloom. We need to be careful with the actual core - as that needs to stay black (I intentionally let it stay black even through the bloom). You can do this either by using floating-point render target before the bloom and write some low value instead of black (careful with tone mapping though - yet you might want to go even for negative numbers), or just render the core after the bloom effect. The resulting effect looks like: And as promised - a video showing the effect:
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!