Tag Info

Hot answers tagged

15

I haven't looked at specific implementation of A* by Aaron but with a normal A* you could include the 'block tower' as passable terrain but update the heuristic so that the 'cost' is much higher than a normal tile (so that AI will evaluate whether it is easier to destroy the block and continue or simple go around via the path that is not blocked). Then you ...


9

In C#, having an instance (non-static) method in a class does not copy the instructions for each object created from that class. Static or not, the data that represents the instructions only exist in one place. The member variables, or state, of each of the instantiated objects do get their own space in memory. When you write a non-static method on a ...


1

I have faced similar problem before. I am pretty sure that co routines won't help you reduce the lag. Multi threading will be a proper solution instead of co routines. But apparently I didn't use either of them. My game had finite predefined pool objects. So instead of instantiating them, in the editor I made a parent game object named Pool and made all the ...


1

You can do this if you use Sprite.Create You would typically use this along with a Sprite Atlas, as setting the Rect properly without one would be pretty tedious.


1

You could disable the gravity on the Rigidbody and then just make gravity yourself by writing a script and using GetComponent<Rigidbody>().AddForce(-Vector3.up * Time.deltaTime * YOUR GRAVITY VALUE) and just change YOUR GRAVITY VALUE when ever you want the object to be slowed down.


1

The problem is that you are running your mouse coordinates through Camera.main.ScreenToWorldPoint twice. var v3 = Input.mousePosition; v3.z = 16.0f; v3 = Camera.main.ScreenToWorldPoint (v3); Vector3 worldMousePosition = Camera.main.ScreenToWorldPoint (v3); Deleting the 3rd line will help. When you also have the problem that you are ...


1

I don't know how deep u actually get into 3D development, but the error message is quite clear, at this spot, if u understand what is written. To draw something on a graphics card, u need Shaders to define how sth is interpreted on the graphics card to draw it. There is allways a definition for structures u share between ur code and the graphcis card. In ...


1

You could create a variable for example called timer of type float and make it equal to the amount of seconds you would like to wait, then in the Update() function subtract Time.deltaTime from your timer variable. Afterwards use if statement to check if the timer variable is equal to zero, if so rotate the object.


1

From here, this can be used to calculate the volume of an arbitrary 3D mesh. public float SignedVolumeOfTriangle(Vector3 p1, Vector3 p2, Vector3 p3) { float v321 = p3.x * p2.y * p1.z; float v231 = p2.x * p3.y * p1.z; float v312 = p3.x * p1.y * p2.z; float v132 = p1.x * p3.y * p2.z; float v213 = p2.x * p1.y * p3.z; float v123 = ...



Only top voted, non community-wiki answers of a minimum length are eligible