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.

0
votes
1answer
26 views

Unity - SpriteRenderer. Trying to make sprite from code using Texture2d.whitetexture

I have been trying to write a method that fills a rectangle with a color. I've tried it as a new 2D and 3D project just in case, but this gives the same results. Basically, i want the script to make ...
0
votes
0answers
20 views

Emerald AI animal not fleeing

Hey guys I have set up a =n animal to be a cautions cowered but he stops instead of running away. I am using unity version 2018.3.11 with emerald AI 2.2. Here is how I have the scene set up : Emerald ...
0
votes
3answers
81 views

Count the number of Vulnerable and Invulnerable crops

I have this code that counts how many GameObjects (crops) in the scene GameObject[] crops; and the code to get the health component of each crops ...
0
votes
2answers
56 views

change one object into another, and then back again in Unity

For example, I would like to change a cube into a sphere, then change that sphere into a capsule, by pressing the up arrow. I would also like to be able to change in the other direction. Change the ...
0
votes
0answers
20 views

Check whether an object is fully inside/overlapped by other objects in Unity3D?

I have structures made of voxels (cube gameobjects), and I want to make complex structures from them. But I don't always want to place them on the grid. I want them to be more realistic, like ...
1
vote
1answer
32 views

Unity - Blender models/animations showing gaps

As part of a college project, a member of my group has made some simple chests with an open animation. Importing these into Unity though, I instantly noticed there were gaps where the faces should be. ...
0
votes
0answers
14 views

Unity Timeline controls

Can anyone show me how I could play the timeline backwards through code? Like, after Cinemachine has done cut scenes, and I'll want to reverse the whole cut scene back to how it started, how exactly ...
0
votes
1answer
38 views

UI background animation makes camera render beyond canvas, need fix?

I have a background animation for a menu where I have to make the background larger than the canvas and drag it over it. Even though I am using a panel the same size as the canvas as a mask, this ...
0
votes
0answers
8 views

SteamVR 2.2: Trigger not getting detected from Vive Tracker in Unity3D

I have connected Vive Tracker to a Gun via Pogo pins. I have set Vive tracker as "vive tracker held in hand". How do I get to know when the trigger is pressed. I have tried everything. I created a ...
-1
votes
1answer
52 views

How do I warp the player?

I'm new to unity, and I have two problems. I need to make an invisible area so that, when touched, the player warps back to the start. I need to make a cube that's when touched, it takes the player ...
0
votes
0answers
11 views

Why isn't my custom unity skinned mesh implementation working properly?

I'm creating my own scripted implementation of a Skinned Mesh in unity for collision detection. But I've run into some problems whenever I update the vertex positions using the update armature ...
-1
votes
1answer
28 views
1
vote
3answers
74 views

What is the purpose of the macro UNITY_EDITOR?

I found on a tips guide in Unity that I can do: #if UNITY_EDITOR do_something() #endif And do_something() will only be ...
1
vote
1answer
52 views

Player doesn't move smoothly, when trying to follow position between cursor and player

When my player moves, moving the camera looks like the camera is teleporting to the player, and then after loading teleporting again. I want to make it move smoothly. When the camera is following the ...
0
votes
1answer
9 views

Exported shapekeys to unity don't play correctly (unity 2019 + blender 2.79)

Hopefully someone can shed some light on this I select all relevant parts of the mesh and armature etc and export to FBX 7.4 for use in Unity3d The model itself displays fine and so does the armature ...
0
votes
1answer
53 views

How do you partition a level and create screen transitions out of these partitions?

The levels in Castlevania games, you walk forward and then come to a point on the level where the screen stops scrolling but is not a deadend and there's no door either. They just wanted to transition ...
-2
votes
1answer
29 views

How can a NamMeshAgent be configured to always look towards its next path position, but never move there?

I'd like to have something like an on-screen panel that appears in the direction that you are supposed to go. The panel is a NamMeshAgent with a speed of 0. I was hoping something like this would ...
-4
votes
1answer
69 views

Gameobject becomes a Cube when uploading it to Unity from Blender

I'm making a 3d mobile game, for one of my gamemodes i need "Hexagon" gameobject. According to my research I can create unique gameobjects in blender. So I tried to make a hexagon and export it as an ...
0
votes
1answer
12 views

cursor cannot active and deactive when click ui

I have a player with a third person character controller component. i have a problem with the cursor lock it hide and cannot click the ui button. i already try some coding but error. SORRY Im very2 ...
-1
votes
2answers
88 views

How do I make a C# script in Unity?

I was watching a tutorial on how to script, and I got stuck making the script in the first place. I use Unity 2019.3.0a5
0
votes
0answers
32 views

jump with chain, unity? [on hold]

I'm making a jump like in the image, using the hinge join but when making the jump this tour for all sides, and when the character falls I can not make that on the axis of rotation x is 0 and equal in ...
0
votes
2answers
66 views

How to move Character according to Camera's look direction?

...
0
votes
0answers
25 views

linker command failed with exit code

I tried to create a build for iOS in Xcode but it give an error: ...
0
votes
0answers
20 views

Networking and Timing issue

I have been trying to use the low-level API for UNET and the focus of this problem is this: ...
0
votes
1answer
57 views

can't make my unity character move

so I'm starting with Unity , I followed the john lemon tutorial , and I wanted to apply what I learn on a model on my own coming from blender. Everythings works , animation , rotation , but not ...
2
votes
2answers
57 views

With gravity enabled, how do you move a RigidBody forwards at a specific speed?

I have a perfectly smooth cube on top of a perfectly smooth plane. I am applying a forward-force of 1 unit per second, using ...
1
vote
1answer
19 views

button thumbnail slider effect unity3D

I am trying to make this effect for buttons. i.e the middle one is bigger and is selected. the buttons can be moved left or right by swapping with finger. Does anyone have any idea how to do it?
0
votes
1answer
19 views

custom mesh object orientation is not correct using

I am making a custom mesh with the help of Traingulator script. At runtime, user can click and and generate a point then mesh creation start. Here is the way i am getting user input. ...
0
votes
1answer
29 views

Unity - Scripting Runtime Version Option Missing

I have been trying to open and run my couple-months old project in Unity3D, and I'm getting about 500 errors. So idecided to reinstall Unity. On the tutorial for the project, it tells us to make sure ...
0
votes
1answer
35 views

How can I change a materials properties in my Unity c# code?

Hello everyone I want to change my materials tiling offset in code, but the only way I found to access it other than drag-dropping to a public field in inspector is to check by name. But I then ...
1
vote
1answer
19 views

How can I automatically pause my timeline at a specific time code?

I want to setup a way that the timeline will pause at a particular time/frame. I have tried this, and it doesn't work: ...
0
votes
0answers
35 views

Game Object's Vector3 changing through script without reason

I am trying to do a combine block script. However, I encountered 2 problems: the blocks / the combined mesh isn't showing up anymore when it was, all the blocks where at the same location Even ...
0
votes
0answers
10 views

UV mapping a playing card in Maya for use in Unity (using a SpriteSheet of all the playing cards). One Material or Two?

I am wanting to make a pack of cards in Unity and Maya. I am familiar with UV unwrapping in Maya, but I never used sprite sheet for my models i unwrapped. (They all just fit onto one texture so far). ...
1
vote
1answer
53 views

how to clamp the look at function?

how can i look at a target on 2 axis but clamp the the object's rotation ,to only rotate from -45 to 45 on x and from -60 to 60 on y axis. i used this script to look at target and clamp the rotation, ...
0
votes
1answer
40 views

Access a clone of an instantiated object - not all the clones?

I am trying to access the object I instantiate - basically a prefab car instantiates cars (one after one) ..the problem that when try to move one .. they all move together ... what's the best way to ...
0
votes
1answer
33 views

How can I create a reverb zone depending on audio source location instead of the listener's position?

Is there a way to make a reverb zone act on an audio source not on the audio listener? Or in other words: Is there a way to apply an audio filter gradually depending on a position in space? Let's say ...
2
votes
1answer
544 views

In Unity, How to format Old RPCs into new “PunRPCs”

In older unity versions you could simply used RPC. With newer verisons of Unity my code now doesn't work and it says that it needs to be transformed into "PunRPC" , Pun being "Photon Unity Networking."...
0
votes
1answer
33 views

smooth look at only on x and y

i'm using the script down below to make my camera look at mouse x and y position, and it has a limitation for my camera rotation.the problem is the way my camera rotates is not smooth at all.is there ...
0
votes
1answer
42 views

Unity2D: Avoid attack animation looping during combo

I am trying to implement a combo system in my Unity project. I started with a coroutine to call a single attack and it goes relatively smoothly, the problem occurs when I try to modify said coroutine ...
2
votes
0answers
45 views

What's the “right way” to open a websocket connection inside WebGL?

The official Unity documentation says that, to run websockets in the WebGL player, you should use this plugin on the Asset Store. Unfortunately, following that link leads to a notice that this asset ...
1
vote
1answer
24 views

How to calculate the distance from the camera to make a GameObject fill the screen?

How do you calculate the distance from the camera so that a GameObject fills the screen? I.e. Without reaching out of the view and regardless of screen orientation.
0
votes
2answers
31 views

Custom FPS Controller in Unity 5.6.6f2 not letting me look up or down

Due to the FPS Controller seeming to be broken in Unity now, I started using a custom one by kinifi on GitHub. For some reason though I can't look up or down. I removed the Main Camera so it should of ...
2
votes
1answer
24 views

Tiling texture doesn't repeat, even though wrap mode is set to repeat

For some reason, my floor tiling (set to 100 x 100) only shows on one corner of the plane. Past that corner, it just stretches out to the sides and leaves the middle one solid colour: Here is how I'...
0
votes
1answer
45 views

Why are there weird texture artifacts in baked light which don't appear with realtime light?

This is the comparison of the same scene, realtime light vs baked light. What's am I wrong ? EDIT: In particular, also texture are low quality (see image 2). Why ?
0
votes
0answers
38 views

Unity Raycasting only hitting mesh colliders from particular directions

I have a game which involves clicking to select some objects. Each of the objects has a mesh collider attached to it so that objects can be clicked, handled by the following: ...
0
votes
0answers
18 views

Reseting a multiplayer scene in UNET, without losing connections

I have a game with only one scene, which has the basic Network Manager HUD. After I click "Host", and a few players join one by one, I want to restart the scene, so the early joiners won't have ...
0
votes
0answers
36 views

Why my mesh is flat and change position?

Befor Start: (It's basic cube) After Start: (It's must be Eye) Code: IngredientAsset: ...