Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

STOP: this is probably not the tag you want. UnityScript is a deprecated language. For new questions about scripting in Unity, you probably want the tags "Unity" and "C#"

0
votes
0answers
15 views

how to update game that uses Sqlite on android?

im working on android game that uses sqlite. i need to update my game in periods of time. my game updates are implemented on database and also player progress and saves are on same database for ...
0
votes
0answers
11 views

Problem in GLTF and collada library

I am trying to use collada library to import a 3d model in unity scene at runtime(for desktop application). As per this answer i insert collada files on unity it didn't accept this line (shows an ...
0
votes
0answers
14 views

translatory motion of a unity game object based on orientation

I have a unity game object which changes its orientation based on orientation data from smartphone sensors. I am using the code below. What I don't know is to move the object based on orientation. ...
0
votes
1answer
21 views

unity job system for 2d or more dimmension arrays?

I need to send a 2d array to a job system but execute function of IJobParallelFor just accepts one dimension. This is the example: ...
1
vote
1answer
53 views

Why can't we put GameObject's into a NativeArray and pass them to a Job?

I just started using the Unity Job System. It has a lot of limitations. You have to use NativeArray with it and NativeArray doesn't allow many types, notably GameObject's. It says there is a bug that ...
0
votes
1answer
24 views

unity play animations of model with C# without animation controller OR create animation controller at runtime entirely from script

I've been looking around for a while trying to figure out how to play simple animations with Unity via ONLY C# script, with no drag-and-drop involved. So far I've found various tutorials explaining ...
0
votes
1answer
43 views

Difference between Unity's Renderer.sharedMaterial and Renderer.sharedMaterials

What are the difference between Renderer.sharedMaterial and Renderer.sharedMaterials in Unity?
1
vote
1answer
70 views

how to put elements around circle with equal distance?

I know circle formula and know how to draw it. but I want put 4 points on it with equal distance from each other. how can I do that? I work with unity.
0
votes
1answer
21 views

make a unified image out of many sprites in unity

i made a customization character system that it has a seperate image UI for every part f body like eyes, hat, ears and... now i want to make a unified texture out of it to be able to save it as an ...
0
votes
0answers
30 views

Unity. Scroll view, scroll to item in scroll view by script

I have a Scroll view on Unity UI with lots of items on it. Each of them has a title. I have created an alphabet for navigation in scroll view items. For example, if I press "J" letter on alphabet I ...
0
votes
1answer
39 views

Unity. Input in function for UI button OnClick

I am trying to create multiple selections for some items on my UI. To perform multiple selections of items I want a user to hold left control button. But then I add ...
1
vote
1answer
45 views

How to drag 2D objects and stop it if collides with other 2D object?

This is the code I am using but it's not working. It drags other object on collision: ...
1
vote
0answers
25 views

vSync for gameplay in monitor and VR headset in Unity not being consistent?

Following my previous question, I'm building a project, my monitor refresh rate is 60Hz, and in my project I have set my vSync value into 2 so I can get 30fps. ...
-1
votes
2answers
98 views

Unity bowling pins detection

I'am working on bowling ball game and I want to detect how many bowling pins has been knocked down by ball? What is the solution for this problem?
0
votes
0answers
20 views

Unity: camera moving up and down for no reason

I have a standard camera in my scene. With standard I mean the camera you get when you click right mouse > Camera, with no modification except for the transform position and rotation. Then I attached ...
1
vote
1answer
305 views

The value of VSync on vSync Count in Unity

In Unity, we can set the vSync value as "No sync" = 0, "Every V Blank" (60 fps) = 1 and "Every Second V Blank" (30 fps) = 2. But in the Unity Quality Setting documentation , it's written the vSync ...
0
votes
0answers
13 views

Set vSync in Unity Failed

I want to set frame rate of my scene as 30 fps. I used Target Framerate and manage to get fps around 30 (34,30,26, etc). But I need more stable framerate, so I want to use vSync to synchronize my ...
0
votes
2answers
354 views

Unity Quaternion.LookRotation meaning

I've gone through Unity's documentation for Quaternion.LookRotation, but I didn't get the full understanding of how it works. What is the meaning of Creates a rotation with the specified ...
0
votes
0answers
16 views

Syncing animations across different objects

In my game I have the player object which is made up of separate objects to allow for part swapping. Each general part has it's own animator and the overal object has an animator. Let me explain, the ...
0
votes
1answer
116 views

Unity Bowling ball physics

I am working on Bowling Ball game for android. And I want the Bowling Ball to feel like a Bowling ball in the real world. I've already tweaked the Rigidbody values and PhysicsMaterial but it's giving ...
0
votes
1answer
97 views

Loop through multidimensional array in C#(Unity)

I have this data As you can see there's a 2nd board there. Now what i want is something like this PSEUDO CODE ...
0
votes
2answers
63 views

Showing Frame Rate Info in the Unity scene using Custom Script failed

I want to lock the framerate of my scene to 30fps, then I learned from this post that fps info in Editor Stat isn't reliable, that's why my fps is still around 100. This is my script for setting the ...
1
vote
1answer
184 views

Unity Input.GetMouseButtonDown(0) is not working

My code to detect left mouse click is not working Input.GetMouseButtonDown(0) and Input.GetMouseButtonUp(0). But same code for Input.GetMouseButton(0) is working. Code: ...
0
votes
1answer
180 views

Unity ScreenToWorldPoint always giving same coordinates with mouse position

I have a question about Unity's ScreenToWorldPoint. Whenever I use ScreenToWorldPoint(Input.mousePosition) and display the output in console this always gives me the same coordinates. MyCode: ...
0
votes
2answers
169 views

How to hide Game Progress Files saved in Application.persistentDataPath in Unity Android

I am developing a game that saves its state in a text file. I am writing that file in Application.persistentDataPath but my issue is that the game progress file is ...
0
votes
0answers
77 views

What's wrong in switching Script - Unity Multiplayer

I'm trying to switch between weapons but when I want to display another screen "some example" in client I don't see any change! This screenshot shows what I mean. [1] : https://imgur.com/uEUOFhC "...
0
votes
1answer
120 views

Difference between Unity's Camera.ScreenPointToRay and Camera.ScreenToWorldPoint?

What is the difference between Unity's Camera.ScreenPointToRay and Camera.ScreenToWorldPoint. And where we can use these. I've ...
0
votes
0answers
16 views

[Unity]: UI Layouts. Control the row height by highest element. Set image width to width of a cell

I am trying to create a scroll view with layout of several images in a row of different aspect ratio. I need images to have same width all the time. I can't set a fixed cell height because the tallest ...
0
votes
0answers
23 views

[Unity]: How to make RectTransform coincide with image

I am building UI and I need object with image component always fit in parent object by width. Problem is, although Image component has option "Preserv aspect ratio" RectTransform of this object almost ...
0
votes
1answer
86 views

Unity navmeshagent and doors

I'm trying to make an agent patrol around a maze. The maze is proceduraly generated and consists of many rooms connected with doors. The problem occurs when the agent reaches a door. I wrote a script ...
0
votes
0answers
15 views

Stopping a bullet in the hit object

How can i do my bullet stop in the hit object and stay there? In that case i am using a sphere as bullet. My code follow: ...
0
votes
0answers
46 views

Unity's Input.GetAxis(“Mouse X”) smooth when coming back to 0

I'm using Input.GetAxis("Mouse X") for moving an object in my game. The only problem is that I want that GetAxis input comes back to 0 slowly or smoothly. How to do this in Unity?
0
votes
2answers
23 views

MonoBehavior Script that uses UnityEditor - Best practice for Location?

I've created a script which helps me auto-generate a GameObject prefab. It uses some UnityEditor, so it can't be used at runtime ...
0
votes
0answers
51 views

Save Generated GameObject as Prefab

I've written a script which will automatically generate a Mesh, assign a MeshFilter, MeshRenderer, BoxCollider, and RigidBody. This script is meant as a tool to rapidly create a certain class of ...
1
vote
2answers
243 views

is GameObject.Find() a bad idea even for one frame?

as I searched GameObject.Find and GameObject.FindwithTag are heavy to work with and for reall projects its better to find ...
3
votes
2answers
505 views

Objects' coordinates and scale adjustment according to different devices resolution and aspect ration in Unity

E.g I have a bunch of objects which are generated in specific coordinates. Let's say in a range of - 5 to + 5 on X axis. I came app with these numbers because of camera size I have in Unity editor. ...
1
vote
1answer
91 views

Object pooling with collisions in Unity

I am trying to create doodle jump like game with object pool for platforms. I have created an empty object with box 2D collider attached to it. This object moves with player and should be gathering ...
0
votes
1answer
271 views

Unity RectTransformUtility.ScreenPointToLocalPointInRectangle

What does the unity's RectTransformUtility.ScreenPointToLocalPointInRectangle do I've read unity documentation but I didn't get the clear meaning.
0
votes
1answer
143 views

Changing coordinates of the object with velocity preservation

In Doodle jump, if a player jumps over one side of the screen he appears on another side with preserved velocity and other physical parameters. I made two trigger colliders on the sides of the ...
0
votes
0answers
40 views

Play Animation during Lerp - Unity

I am moving my player horizontally through lerp and during this movement time only, I want to play walk animation. As movement get complete, it should require to start playing idle animation. ...
0
votes
0answers
186 views

Cutting mesh With an axe? Unity 3D

I want to make a game where log will cut with an Axe on click is there any method to do. I write some code to do so but that seems not good for me . I took 10 meshes of log // Code ...
0
votes
0answers
25 views

open a webpage like facebook from unity and check that really page has opened

I know how to open a webpage from unity but I want t know how can I check that user really has opened it.
0
votes
0answers
39 views

Unity Photon multiplayer :: check distance between two players

How to get distance between two player in a photon multiplayer game. Condition is both the player is moving. I have tried something like this, in my player control script: ...
0
votes
1answer
141 views

Creating dependent values in the Unity inspector

I want to create a few values which will be dependent on each other. Specifically, I want total sum of few values always be 100 In unity inspector no matter how I tweak them. E.G.: ...
0
votes
0answers
95 views

Capture Video without Third Party SDK's

I am trying to capture the game play and store it on local memory without using any third party sdk's. I tried This Video Capture Script but i didn't get the recorded file even i don't know whether it'...
1
vote
0answers
56 views

Gyro and swipe in Unity

How can I properly save rotation of the camera while swipe and pass it to transform.rotation = Quaternion.Slerp() start start Quaternion?Right now after I swiped Gyro get his transform.position and I ...
0
votes
1answer
30 views

Unity Player Movement Script nullifies gravity

i want my Player to be affected by gravity, while being able to be moved in horizontal direction(the Player jumps up and down), but my script: ...
1
vote
1answer
35 views

Unity Player Movement Problem

I want to make a little game in Unity, where the player (a ball) jumps up and down and you have to maneuver it through (flappy bird like) obstacles. My problem is, after I added a simple movement ...