Tag Info

New answers tagged

1

What about GUI, sound, asset / resource management, levels / maps, quests etc.? These are all good candidates for scripts. Most of the game can typically be written in a scripting language. Typically the only thing that may require being written in the core language (C, C++, C#, Java, etc) is anything that is performance critical or core game ...


1

Whatever's most amenable to encapsulation or is already well specified - and thus well encapsulated - in C++ classes / functions, i.e. exists behind a stable, solid interface. Aspects that are ever-changing, and aspects that are coded at a low level and need fine control like rendering and low-level network code, are poor candidates for scripting. It ...


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.


0

if I understood : "Now I have an angle in eulers and I want that the ball goes to the direction of the angle. But how I calculate it?" You need : dirx = cos(angle); diry = sin(angle);


0

You don't need your Direction() function. It also doesn't return euler angles. Unity's Vector3 class has all the functions you need. See the code below. Vector3 pos1; // start position Vector3 pos2; // click position Vector3 moveDistance = 3.0f; // move 3 units in the calculated direction Vector3 delta = (pos2 - pos1); // delta is the vector difference ...


0

The computer is not aware of what type of object is moving around, whether it is a character walking/running (which you don't want to launch when it hits a ramp) or a car driving (which you would want to launch). Since you said that your character is moving at high velocity, that would explain why it is launching. It is best to think of your character as a ...


3

Each rigid body has an attribute indicating if it's affected by gravity or not. You can just mark that attribute as true, whenever player enters the spaceship, and later turn it false, when he exits. But that'll limit you with a big limitation. The gravity itself in unity is something global, meaning all entities are affected by same gravity force (if any). ...


0

Under the rigidbody tab in the hierarchy freeze rotation X and Z. This will keep them from falling over. Then you should be able to apply gravity on the Y axis without a problem.


1

If you want to initialize data, and for it to be available in the Editor, take a look at ExecuteInEditMode. So you could add a new script component to your Level object, and have something like this: #if UNITY_EDITOR using UnityEngine; using UnityEditor; [ExecuteInEditMode] public class EditorRefresh : MonoBehaviour { void Update() { if ...



Top 50 recent answers are included