lvictorino
  • Member for 11 years, 3 months
  • Last seen more than a month ago
What is unit slotting?
18 votes

It's, I guess, about how the enemies run toward the player. Slotting implies that, to let the player survive and give her a chance to continue surviving, enemies coordinate themselves to not attack at ...

View answer
How can I avoid having many singletons in my game architecture?
18 votes

I won't discuss about the evilness behind singletons because Internet can do that better than me. In my games I use the Service Locator pattern to avoid having tons of Singletons/Managers. The ...

View answer
Making a game engine or using Unity3D?
Accepted answer
7 votes

Your question let assume that you want to gain knowledge in game development. As I understand it, you want to make games but don't really know what is the best for you. Long story short: don't ever ...

View answer
How do I serialise a mesh to a text file?
Accepted answer
5 votes

I think the obj file format is what you need. OBJ is pretty commonly used in 3D graphics, and it's a text file. You will need to walk through your mesh properties and write your own file. Then you'll ...

View answer
Multiplayer and creeps (NPC enemies): how to compute bullet hits given the lag?
Accepted answer
5 votes

Something seems wrong to me in your implementation of the authoritative server. Basically an authoritative server controls everything. It is the pivot of your network architecture. Clients just "...

View answer
Inventory objects not persisting between scenes?
Accepted answer
4 votes

gm.GetComponent<Inventory>().AddItem(Instantiate(items[randInt])); On this line you instantiate a new GameObject on your scene, which happens before loading the new scene. You put a reference ...

View answer
How can I resize my Blender models when importing to Unity?
4 votes

Take care about unity import settings... If you click on your model in unity you will see scale factor among the parameters. Take care the value is correct to fit your needs.

View answer
How should a player object to communicate with a map object?
4 votes

Your question is a bit wider than you exposed I think. Player and Map are two objects and should be thought as it. They are not different, from an engine point of view, of a ping-pong table or a ...

View answer
In unity i have this code that has to make a lot of allocation but no new variables are creates, but still the RAM usage just keeps climbing
3 votes

Instantiate seems to be the culprit here. You're trying to instantiate THOUSANDS of new game objects in a single frame. I would recommend to delay the instantiate by batches of 100 per frame. EDIT: ...

View answer
Selected enemy off camera
Accepted answer
3 votes

You can easily know if a world point is visible by a given camera using Camera.WorldToViewportPoint. This will return a Vector2 that represents the position of your object in the viewport. A viewport ...

View answer
Locking frame rate to 60 in the editor
3 votes

Note that "targetFrameRate is ignored in the editor". Also, it worth noting that FPS number displayed in the Editor stats window is not accurate at all. I even came to a point where I wonder if the ...

View answer
Designing a weather system for biomes in a roguelike
Accepted answer
3 votes

[It may be worth noting that I have never played dwarf fortress] Both approach seem relevant. Also usually in games the most complex part about weather systems is often the equation behind it. As you ...

View answer
How to design a drag and drop inventory system with transition from icons to game objects?
Accepted answer
3 votes

[EDIT] As your question, now clearer seems to be more about design and not so much a technical question I change my answer a bit. Your first attempt was the right one. Your sprite contains a drag&...

View answer
How do I change the material of an object with Script in Unity?
Accepted answer
3 votes

If you want to change a Material in Unity you have to retrieve it first. If your GameObject uses a Material it means that it uses a Renderer. You can retrieve your object renderer using the internal ...

View answer
How to save a Unity prefab on file?
Accepted answer
3 votes

It seems that you mix up GameObjects and Prefabs. When you say "Prefabs in another scenes" I think you are talking about Game Objects. Game Objects are objects, prefabs or not, who are in a scene. ...

View answer
For the handling of buildings on a tile-based strategy game, what aproach should I use?
Accepted answer
3 votes

I prefer the first strategy because it allows a lot of liberty for rendering process. I use it for my 2D games since the day I had to make a building transparent... it avoids the massive use of ...

View answer
Positional sound with headphones?
3 votes

There are some tricks to fake the "in front" and "behind" effects. But this is not simple to implement in order to have a real sexy effect. You will find some tricks in the Blumlein's approach on ...

View answer
Unity and Blender integration .blend
2 votes

According to documentation, Unity imports .blend files through FBX. You're going to export your scene to FBX if you want to use your assets in your Unity project.

View answer
Unity 3D move kinematic rigidbody
Accepted answer
2 votes

If isKinematic is enabled, Forces, collisions or joints will not affect the rigidbody anymore. As explained in rigidbody documentation page, when the property isKinematic is set to true, collisions ...

View answer
How to attach main camera to script component of a prefab?
Accepted answer
2 votes

Let's do it the other way ;) When you Instantiate ItemDrop, you can retrieve LifeTimer from the Camera and save it. For instance, right after the instantiate of your prefab, the method Start() of your ...

View answer
Animation inside GUI
Accepted answer
2 votes

I suppose you're talking about the new UI system (coming with UnityEngine.UI) and not the old GUI system. If you want to display a 3D model in a GUIButton, you can simply use a Render Texture. In ...

View answer
How to select multiple frames from a sprite sheet in unity
Accepted answer
2 votes

I'm not sure about the timing when you need or want to select multiple frames at once. But as I read it, you may just want to press control (CTRL) while clicking on your frames to select several of ...

View answer
Simple Line Formation
Accepted answer
2 votes

Well I hope I understood your question correctly: you want your squad members at the same distance from one to another, facing the same direction and forming a line. First I'd tackle the direction ...

View answer
Make HD trailer for Unity game
2 votes

You can easily capture 4K screenshots in Unity. All you have to do is capturing enough of these and assemble them into a video. Adobe Premiere is great for that (no doubt that After Effect can do the ...

View answer
How to find the optimum path, on a road, for a car?
2 votes

Technique generally used on AAA games to find the best possible path for a given car (because car settings are often all different) is to run an AI that will improve its driving technique. After ...

View answer
Where to put graphic representation of game entity?
2 votes

That said, there is no golden rule for that kind of thing, but it will mainly affect your architecture. I would suggest you to take a look at the component pattern (which is used by some game ...

View answer
How do I save variables and load them in Unity with JavaScript?
Accepted answer
2 votes

Look at PlayerPrefs class. It's a key/value system that allows you to save, or read, a value.

View answer
How do I use elapsed time as the player's score in Unity?
Accepted answer
2 votes

What you're looking for is the Time object. And Time.time in particular. Time.time contains the time in seconds since the game has started (or the level has been loaded). So you want to know how many ...

View answer
How to get GameElements (RigidBody) size in Unity?
Accepted answer
2 votes

Have you tried using bounds ? I guess you can achieve what you're looking for using : float brickWidth = brick.renderer.bounds.size.x;

View answer
Particle effect after the bullet
Accepted answer
2 votes

You do not talk about code so it's hard to give you the good advice. Anyway it seems that your particles are spawned at each frame... and as your bullet travels very fast, each frame means a long ...

View answer