Quantcast
Browsing all 90 articles
Browse latest View live

Answer by Kleptomaniac

Have you tried enabling your Box Collider and Rigidbody when escape is first pressed and then disabling when pressed again? Since enabling and disabling these two components is not possible there are...

View Article


Answer by Kleptomaniac

Well, that totally depends on what current health system you have! But generally, assuming you already do have some manner of health system set up, the C# method is pretty much exactly the same as the...

View Article


Answer by Kleptomaniac

Just use a raycast from your cursor coordinates. Like so: void Update () { if(Input.GetButtonDown("Fire1")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit;...

View Article

Answer by Kleptomaniac

I believe you could try using a switch-case method for this (never worked with switch-cases before though so we shall see how I go): void Update () { switch (yourRandomVar) { case 0: yourRandomVar =...

View Article

Answer by Kleptomaniac

Yeah, that's because selectedTarget is typecast as a Transform, while my code specifies it as a GameObject. My bad. :D Change this line: selectedTarget = hit.collider.gameObject; to: selectedTarget =...

View Article


Answer by Kleptomaniac

Here's how. Just use an array of materials and cycle through them with each successive mouse click. Then apply your newly chosen material to your mesh and your good! So like this: var matArray :...

View Article

Answer by Kleptomaniac

Yes, this is because of the structure of arrays. Let me explain. Say you were to have an array of ints called intArray which contains [5, 10, 15, 20, 25, 30, 35]. The way in which array elements are...

View Article

Answer by Kleptomaniac

This is easy to implement. Add all your FPC's to a built in GameObject array in the inspector: `public GameObject[] charInst;`. Depending on how you want your GUI button layout to be, you can link an...

View Article


Answer by Kleptomaniac

Hey there, All you need to do is store your ID within tags assigned to your individual GameObjects like so: `gameObject.tag = ID;` and then use [GameObject.FindGameObjectsWithTag()][1] to find your...

View Article


Answer by Kleptomaniac

It means that EtceteraManager.cs is referencing the class AbstractManager, however AbstractManager doesn't exist for some reason or another. It's likely that the AbstractManager script is either...

View Article

Answer by Kleptomaniac

Yes, that is because it is a component of your camera and is only rendered while your camera is active in game. Within your scene, you are using your scene camera. That is normal behaviour. If you'd...

View Article

Answer by Kleptomaniac

As long as when you build your game, in the Platform Settings, you use 'PC and Mac Standalone', then your game will be compatible with both Mac and Windows. Unity does everything for you. :) For more...

View Article

Answer by Kleptomaniac

As is said [here][1], it isn't possible to set the cursor position without external .dlls. Screen.lockCursor doesn't automatically set the position of the cursor to the centre of the screen, it only...

View Article


Answer by Kleptomaniac

I would suggest cleaning this up. As @IgnoranceIsBliss said, strings can already be accessed as arrays. Therefore you can eliminate your SplitString function. Also, I'm assuming that underScore is the...

View Article

Answer by Kleptomaniac

To determine the direction that your character is facing, try [Transform.forward][1]. To rotate an object based on the position of another gameObject, try [Transform.LookAt][2] like so:...

View Article


Answer by Kleptomaniac

Have you tried enabling your Box Collider and Rigidbody when escape is first pressed and then disabling when pressed again? Since enabling and disabling these two components is not possible there are...

View Article

Answer by Kleptomaniac

Well, that totally depends on what current health system you have! But generally, assuming you already do have some manner of health system set up, the C# method is pretty much exactly the same as the...

View Article


Answer by Kleptomaniac

Just use a raycast from your cursor coordinates. Like so: void Update () { if(Input.GetButtonDown("Fire1")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit;...

View Article

Answer by Kleptomaniac

I believe you could try using a switch-case method for this (never worked with switch-cases before though so we shall see how I go): void Update () { switch (yourRandomVar) { case 0: yourRandomVar =...

View Article

Answer by Kleptomaniac

Yeah, that's because selectedTarget is typecast as a Transform, while my code specifies it as a GameObject. My bad. :D Change this line: selectedTarget = hit.collider.gameObject; to: selectedTarget =...

View Article
Browsing all 90 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>