Questions tagged [unity]

Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

Filter by
Sorted by
Tagged with
1
vote
0answers
38 views

Line of sight shader

Strategy games (such as Door Kickers) use a player's unit's line-of-sight as a major game feature. To provide feedback to the player regarding which areas are in view and which are not, different ...
0
votes
1answer
45 views

Unity3D/AnimationRigging - Rig not a child Transform in the Animator hierarchy

I'm using Animation Rigging in Unity and was having some success until I realized my rig was built on the wrong GameObject. This was causing the Animator on the character to be overridden by the ...
0
votes
0answers
26 views

Hlsl Refract() not refracting rays correctly

I'm making a ray tracer in unity and I'm trying to model refraction, however when I use refract() in my shader it doesn't change the ray direction at all. here is a ...
1
vote
1answer
33 views

Why does my collider behave strangely after a coroutine

So I'm trying to create a simple script that is going to handle the logic for cutting down a tree I'm experiencing some strange behaviour with my script. I have a private field which holds the "...
0
votes
1answer
29 views

Unity - How to don't ignore a layer when Raycasting?

For example: Physics.Raycast(ray, out hit, range, layerMask), let's say layerMask = groundMask. What I want to do is only return ...
0
votes
1answer
49 views

Another try. List don't remove properly

I hve that script: ...
0
votes
0answers
21 views

How can I change isReadable of imported DDS images?

I'm importing DDS textures from editor scripts and I need to access the GetPixels() method from each imported texture to check if the image have transparent pixels. ...
0
votes
3answers
68 views

How can I play an animation as long as the player is on the pressure pad?

I'm making a 2D platformer with Unity. Recently, I implemented a pressure pad system. Basically, when the player triggers the pad, a door near there should be opened. The system works properly but the ...
0
votes
0answers
19 views

How can I make responsive computer and touch click and drag?

This code works but it has a little delay on computer controls and higher delay on mobile touch screen controls, so its not responsive as I want it to be. ...
0
votes
3answers
33 views

OnMouseOver not registering collisions

I'm working on a UI-heavy game and I'd like to add sound effects for when the player mouses over a UI button (using TMP, if that matters). I've tried OnMouseOver and its siblings OnMouseEnter and ...
0
votes
0answers
14 views

Rope 2D Hinge disconnection

I have a game that needs to use a rope-like mechanic should do two things. Restrict Player's Movement within the length of the rope. In other words, some kind of rubber band that brings the player ...
1
vote
0answers
17 views

Sprite UV returning wrong values in script in newer Unity versions

I'm recreating in Unity 2019.4 an old project I have done few years ago in Unity 5.4.0. This project consists of a tiled map editor using unity editor scripts which reads baked data files containing ...
0
votes
1answer
29 views
1
vote
0answers
29 views

Unity, VRChat SDK3, Udon Graph (bug?)

I'm trying to create a VRChat world in Unity, using VRchat World SDK3. But I'm getting a strange behavior in Udon Graph assets (as shown by the arrows in the screenshot). Steps I took: I've installed ...
0
votes
0answers
21 views

When I use rigidbody.move rotation, my player sinks

I am trying to implement a simple movement on an object and when I use movePosition from rigid body, the player starts to sink: How can I resolve this issue? Below ...
0
votes
1answer
59 views

Calculate mesh normals with added noise

I'm creating a procedurally generated planet object in Unity. I start with a cube which is created from 6 meshes (6 sides) and normalize the vertices to get a standard sphere. The problem is that ...
1
vote
1answer
62 views

How can I create a pressure pad in order to open a door?

I'm making a 2D platformer with Unity. I want to create a pressure pad in order to open a door and I want the door to open when the player is on the pressure pad and close in few seconds after the ...
0
votes
1answer
49 views

How do I get a reference to a component on a sibling object in C# Script?

I'm working on a game, where the player dumps trash from Trash cans into a Trash Truck. These Trash cans have a random chance of having a Racoon on top of them. I have a script set up to detect when ...
0
votes
0answers
21 views

Instantiate works fine in Editor and does not work after building game

Here is the situation, In my project everything works fine. After I build the game for windows, the prefab does not instantiate. I don't know which part I missed. This is how I load the prefab from ...
1
vote
0answers
28 views

Tweaking screen transitions not to fire every time in Unity

I'm making a simple screen transition system for my game which consists of two states firing the right clips (one for the starting half od the transition animation, one for the ending one) and a ...
1
vote
0answers
26 views

How to make script awake again after sleep?

I disabled gamecontroller for 15.9 seconds and controller not awake again.It's for cutscene cam before the race start. ...
0
votes
0answers
45 views

How can I change the root namespace for scripts in Unity?

How can I change the root namespace for scripts in Unity? I went to Edit - Project Settings... - ...
0
votes
0answers
52 views

Something is wrong when my player is jumping on walls

When my player jump beside walls and it reached the top of the wall, it's forcing the player to stop at the point of top of the wall. Like if my player y is higher than the y of the wall, it's making ...
0
votes
1answer
37 views

How do you detect which side of a cube is facing up/down/left/right?

Please imagine a scene that shows a cube. Both the camera and the cube can be randomly positioned and rotated. How can you tell which side of the cube is facing up/down or left/right? Or in other ...
0
votes
0answers
10 views

How would I use an object from another animation in Unity?

So I have two different .blend files with two different animations. Let's call my aiming with a gun animation animation A, and my other .blend file with idle, run, and jump animations animation B. If ...
0
votes
0answers
11 views

GraphView: Dragging a Blackboard causes it to get stuck offscreen

I'm playing around with learning GraphView, and running into some strange problems with the Blackboard component. Here's a very simple repro: ...
0
votes
1answer
36 views

Why do I get a jitter/stutter when moving and following a target?

I am using the script below to move a transform to quickly follow a target (the player), and come to a stop close to the player. When I move the player around, the transform is following the player, ...
1
vote
0answers
15 views

Moving Object Interception / Projectile Collision [duplicate]

I am using Unity to attempt to have missile A launch at incoming missile B and blow it up. However in order to do this accurately, A must be able to take into account B's current velocity, direction ...
0
votes
1answer
44 views

Extending a ScriptableObject to have a get property instead of a field, without losing serialized data

I have a ScriptableObject that's already used extensively in my project: ...
0
votes
0answers
14 views

What's the best for doing ground check?

What's the best for ground check? I have a capsule player and I'm using the raycast technique but it's not accurate when it comes to slopes. So what's better? Overlapping, Raycasting, CheckCapsule, or ...
0
votes
0answers
19 views

How would I edit .anim files in Blender?

I absolutely cannot stand animating in Unity. I am making an FPS game with many weapons, and each weapon has four animations: running, jumping, aiming, and shooting. I would like to create a .anim ...
0
votes
1answer
16 views

How would I add keyframes to my animation clip from another object in Unity?

I am creating an FPS game which will have many weapons that have their own animations. I will need to access keyframes of the character's position, rotation, and scale, how will I do that? I can only ...
2
votes
1answer
58 views

How do I get the local player?

I'm using Mirror as UNet is deprecated. How can I get the local player GameObject in my code?
0
votes
1answer
20 views

Extend distance for rendering grass and tree objects on terrain

I am trying to make an adventure game with a big landscape (made the terrain with terrain tools) with 3D models of grass (that I placed using terrain tools) but it only shows the grass/trees that are ...
0
votes
0answers
7 views

FBX exported from C4D and imported into Unity creating new materials

When importing a FBX model created in C4D, unity is creating new materials for certain meshes. For example, I have a material in C4D applied to my model called Metal. When imported into unity a new ...
0
votes
0answers
19 views

Do all included assets become part of built outcome or only the ones in use? [duplicate]

When building a unity game, does it include all assets inside the project folders etc or only the ones used? Can Unity really tell if a prefab is used anywhere or a sprite or any downloaded package ...
3
votes
2answers
58 views

Interpolation on Rigidbody2D not working

I'm trying to achieve smooth movement for a ball. I seem to be failing to achieve this and now I've created a sample scene, which shows my setup from the game and the problem exists in that sample ...
0
votes
0answers
11 views

Unity color transparency is affecting image transparency

I am building a chess board in Unity. I have a Grid Layout component made out of 64 Single_Field PreFabs. I instantiate the field like this ...
0
votes
2answers
36 views

Unity - Renderer “raycasts” from top down?

I'm trying to have objects in a game be selectable only from a top down orthographic camera view. I think having physics colliders might be overkill for that - especially because this only needs to be ...
0
votes
0answers
33 views

How can I achieve area fill in the video?

I am trying to clone a game while learning Unity but I am stuck. How can I achieve area fill like shown in this Area Fill Example Video? When I searched for it I found the "Flood Fill" ...
0
votes
1answer
52 views

World position into local position

I want to understand how I can convert world position of an object into local position. Especially how to deal with a rotation of objects. I'm testing transform.InverseTransform(...) methods. When ...
1
vote
1answer
36 views

Why does my material look blotchy on this mesh?

This is a generative mesh - wireframe looks like this Here's the material But the shaded object looks like a tie dye tshirt I've no idea what settings are causing it to look like this. These are ...
0
votes
2answers
155 views

All Materials are pink (Unity URP)

Version: Unity 2020.2.0f1 I started my project with Universal render pipeline template but I don't know why all materials are pink. i even tried to upgrading but nothing happened. This error was ...
0
votes
0answers
28 views

Difficulty researching dynamically posable characters for game box art template scene

I want to buy something specific but I don't know what to call it or how to find it. I recently had an idea for cover art for my 3D game: I want to buy a scene of dynamically posed characters and swap ...
1
vote
1answer
22 views

Clipping speed when turning without using aggressive drag

I have a Unity project in which I want to control a player in a similar way to Source games, and so far I am clipping each input to the speed in the player's coordinates, by using ...
0
votes
0answers
51 views

Cutscene Scripting for CameraController

I have a CameraController script which follows a GameController if it's present in the scene. How can I add cutscene animator to ...
0
votes
1answer
41 views

The farther I move my character, the more its projectiles fire in the wrong direction

I'm making a top down shooter, and the movement is working fine. However, I'm having trouble getting my Fire function to work correctly. When I run the game, it kind of fires in the right direction, ...
0
votes
0answers
74 views

How to randomly change the color of a Shader Graph Material for only a specified GameObject, with C# script?

I'm working on a game, in Unity3D, where the player picks up trash from Trash cans, and dumps the trash from the Trash cans into a Trash Truck. The world of the game itself is randomly generated, with ...

1
3 4
5
6 7
270