JPtheK9
  • Member for 7 years
  • Last seen more than a month ago
  • New Mexico
Collision Response in Entity Components Systems
1 votes

You can call certain collision events like Unity does, allowing components to exist independently but still work together. For my physics engine, I have all collision processing centralized so ...

View answer
How could you create an SSX style snow trail in unity3d?
1 votes

Trail or line renderer: http://docs.unity3d.com/Manual/class-TrailRenderer.html. Just have a darker texture to overlay the snow and continuously set a new position for the trail renderer.

View answer
Good design for skills (heal,dmg etc)
1 votes

OOP is your friend here! Many skills will have similar traits and you can categorize them so you don't have to recode every aspect of every skill. For example, skills will all be attachable to a ...

View answer
In the game loop, apply dt before the loop starts, or after it finishes?
Accepted answer
1 votes

dt, which I'm assuming is the time between frames, should be added to m_time at the beginning of the frame so that m_time will be the time since the start of the game when you use it later on in the ...

View answer
Unity Vector3.MoveTowards over the span of a minute with Time.deltaTime
Accepted answer
1 votes

You're better off using Lerp. float ElapsedTime; float FinishTime; Vector3 StartPosition Vector3 Target; void Start () { Vector3 StartPosition = Vector3.zero; Target = Vector3.one * 50; ...

View answer
Trying to implement gun cooldowns in C#
1 votes

Coroutines are the best performance-wise. I.e. void Start () { //Starting the coroutine StartCoroutine (Shooter()); } IEnumerator Shooter () { if (Input.GetMouseButton(0)) { /...

View answer
What are the key ingredients for a good game-specific community website?
1 votes

Above all, I think it's the community. The community's demeanor is often not in the developer's control but there are things that can be done to promote a friendly culture. For example, rewarding ...

View answer
RPG stats degrading by level
1 votes

In addition to having a Stat variable, have a StatIncrease variable and decrease StatIncrease with every level. I.e.: float Stat = 0f; float StatIncrease = 10f; void LevelUp () { Stat += ...

View answer
Particles in particle system not being lit
1 votes

Certain shaders don't react to light, and it's possible certain lights won't effect particles. Make sure the light you're testing with is set to Auto or Important Render Mode. Also make sure you're ...

View answer
RPC events with client side interpolation
1 votes

The easiest way to implement interpolation correctly is by using fixed time steps. Basically, if you know you're going to get a new position about 10 times a second, you can interpolate from the last ...

View answer
Sphere to plane collision never rearching resting contact
1 votes

Instead of checking the distance for a resting contact, check for velocity. If 2 objects are moving slowly and hit each other, they should be put to rest. If not, they should do what they would do if ...

View answer
Unity 3D - Rotating an object in relation to its velocity
1 votes

The easiest way to rotate an object to face the direction of its velocity is to represent the rotation as a vector. Unity's physics does this internally, but unfortunately won't let you access any of ...

View answer
How should I implement units' enemy "awareness"?
1 votes

Another solution that scales very well and can be used for a multitude of other things is an influeunce map. Generate a set of grid tiles around the unit to scan within X radius. Scan these tiles for ...

View answer
How to occlude lights in Unity3D?
1 votes

You could write your own script to occlude lights. Something like this attached to the main camera: List<Light> Lights = new List<Light>(); const float OccludeDist = 100; void Update() { ...

View answer
Assign each player a unique ID?
Accepted answer
1 votes

Okay so I played around with the ID assignments a bit and came up with this: After every player is assigned and ID, the number gets put in a list called TakenIDs. A for loop checks which number isn't ...

View answer
Unity Canvas blocking objects in Editor
Accepted answer
1 votes

Click the canvas and move it back or forwards along the Z axis.

View answer
2d mmo open world connection and reconnection
0 votes

Most of the time, the size of the world doesn't matter as much as the number of players. For just 10 players, you can get away with a lot of things. Unless the world changes, syncing game states ...

View answer
Unity PHOTON/PUN Collision Detection
0 votes

Property replication (which is what Photon does) and physics don't go well together. For first-person shooters, this is okay because all physics needs to be used for is keeping the player from going ...

View answer
XNA/C# Convert polygons into tilemap
0 votes

There is only 1 optimization you need to implement: Vector2 Min, Max; Min = poly.Vertices[0]; Max = poly.Vertices[0]; for (int i = 1; i < poly.Vertices.Length; i++) { Vector2 Vertex = poly....

View answer
At what point of Game Dev pipeline it is good idea to start adding Oculus Rift Support?
0 votes

I've never used OR before but it might be like mobile where you make 90% for PC then configure the rest for the specific target. This allows for fast and easy testing so you can focus on the ...

View answer
UnityEngine.PlayerPrefs corrupts string?
Accepted answer
0 votes

I browsed the UForums and found a solution. It turns out, Unity serializes strings in base64 so to save/extract data to/from a string, one has to save the data in that encoding. I'm not too keen on ...

View answer
Creating a Collision Detection system
0 votes

If you have an array of all objects in the simulation, you can do something like this: Collider[] Colliders = new Collider[]{col1, col2, col3, col4...}; void Simulate () { for (int i = 0; i < ...

View answer
Handling Multiple Resolutions
Accepted answer
0 votes

Conceptually, games can adjust to screen resolutions by scaling UI elements. If you want to take the easy route and use Unity's UI, this can be done pretty easily with a Canvas Scaler. I don't think ...

View answer
Changing scene while joining room and RPC buffer problem
0 votes

A more reliable and efficient method of syncing new players is delegating this task to another player. Since Photon's servers aren't authoritative, this is the next best option to catch someone up. ...

View answer
3D collision for non mathematician
0 votes

Sphere collision is definitely the easiest to implement. Simply do distance checks between 2 objects. I.e.: if ((ObjectA.Position - ObjectB.Position).magnitude > ObjectA.Radius + ObjectB.Radius) { ...

View answer
Unity associated game object is null when running
0 votes

This is very strange. I've heard of MonoBehaviour null checks not be consistent but an object just becoming null? Strange. A few first bases to cover: You're not destroying Brokenboxref Brokenboxref ...

View answer
What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?
0 votes

Recognizing time is pretty expensive but you can do it just once with a System.Timers.Timer and let that drive your timers. I.e.: public class EfficientTimer () { //A static timer that drives all ...

View answer
How do you get a multiplayer-only game to reach critical mass?
0 votes

Especially for paid games, a single-player mode is beneficial since your players will always have the opportunity for bang when they open up your game. If a player can't find an online match, he can ...

View answer
Encoding/decoding data with byte arrays
0 votes

I was brainstorming something like that where the first 5 bytes in my array will define the lengths of all my numbers (types won't be needed; they're all integral numbers). The first 4 bytes ...

View answer
Coroutine to move to position passing the movement speed?
-1 votes

Get the velocity to move at based on the object's size and the speed. Move with that velocity. Then keep checking if the object has passed the target. IEnumerator MoveObject (Vector3 source, Vector3 ...

View answer
1
2