Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [unityscript]

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#". Only use this tag for questions about legacy code written in UnityScript, the old JavaScript-like scripting language available until Unity version 2017.2.

0
votes
0answers
10 views

Instantiate an object by translating it randomly

My goal through this code in C # is with each support of a key to create a cube, to a fixed position given by another object, but taking a random direction translation support 1> translation 1 ...
0
votes
1answer
27 views

should my static class be derived from UnityEngine.MonoBehaviour instead?

I am working on creating an object to maintain state of the game, player data, etc. It is static (singleton lifecyle) through the life of my game. I started down the path of a static class, with a ...
3
votes
1answer
59 views

Unity3d UnityWebRequest EscapeURL standard does not match Swift url encoding. How to decode it?

How should I decode escaped URL by unity in Swift? I am developing a game with Unity3d. Something MMORPG. With server implemented by me in Swift under ...
-2
votes
1answer
63 views

How to move a 2D boat in unity

I am working on a 2D game in which boat moves continuously but the direction of the boat is on users touch. Where the user moves its finger the boat moves in that direction. How would I achieve this? ...
1
vote
0answers
24 views

Scene for Computer Screen

We are developing a scene that will involve heavily interacting with a "touch screen monitor" in the scene.. Because the workflow of the touch screen will need to be dynamic we are creating a REST API ...
0
votes
0answers
27 views

How to make mobile movement using CharacterController

How can i change my movement for mobile i think left and right gonna work but i don't know what should i do for jump ...
0
votes
0answers
20 views

NullReferenceException until tile is spawned [duplicate]

I have a tile and tile has enemies spawn positions, and spawner script in it. Everything works fine when tile is spawned, my ray hits the collider in tile and enemies get spawned, but my spawn script ...
0
votes
1answer
38 views

why is GetComponent<ICameraControl> returning null?

As you can see in the attached image below and the code, I have added a class that implements the interface ICameraControl attached to a ...
1
vote
0answers
24 views

Discrete line inside a 3D matrix

First of all a little premise: I'm following this tutorial on YouTube for procedural 2d cave generation in unity using cellular automata and I'm extending it in order to make caves in all three ...
0
votes
0answers
32 views

Unity Erase Image from mouse pointer

I want to erase the image for mouse pointer in unity. My pointer should be as a eraser. What is I do create the eraser? My sprite is always change because it provide from the server. Please help me.
0
votes
0answers
23 views

How simulate day/night transition on 2d game? [duplicate]

I'm trying to create a 2d game and I want to have a day/night transition, but i'm actually new on Unity and I don't know how to do it, I'm using this code, but give me error and I really don't even ...
1
vote
2answers
60 views

Detect Collisions While Dragging 3D Game Object

Hello i am making a game in which i have to drag a sphere on x axis and z axis on a plane with my mouse and i have created walls from cubes so that my sphere not go anywhere else in the game but while ...
0
votes
1answer
102 views

Custom shadow mapping in Unity. Works with preservative Light view but not with Orthographic

So about a week ago I decided to make my own shadow mapping technique in Unity based on my understanding of the whole thing. The entire experience was somewhat successful. I learned a lot and I get to ...
0
votes
1answer
31 views

360 degree Shooting using Pythagoras problem Unity 2D C#

I have used pythagoras to give the bullet a velocity in the bullet class. Velocity is applied when Instantiated(); ...
1
vote
0answers
26 views

How to implement a network proximity checker in Unity using LLAPI?

I'm trying to implement a network proximity checker using my own functions in Unity, using LLAPI. How can I implemnet a network proximity checker, with similar functionalities than the ones in the ...
0
votes
1answer
549 views

AdMob interstitial ads not showing after publishing in playstore

I have create a Unity game, 1st I add an AdMob interstitial ads script on game object then try on my main camera when I test in my mobile before publishing. It has worked like real time ads and ...
1
vote
0answers
42 views

Unity3D - How to create flat map render based on endless noise data

The Project I'm working actually on a Endless Map Generator (with chunks, height-map noise, threading system, etc..) This is actually what "dev data display" look like: The Goal Now I want to ...
2
votes
1answer
317 views

Random Range Without Duplicates

I have an array of gameobjects (some questions) if player hit some triggers a question from the array is displayed randomly, I want to avoid duplication of displaying questions. ...
0
votes
1answer
51 views

Unity - OnTriggerEnter & OnTriggerExit strange behavior

I am having a trouble with OnTriggerEnter with a lot of objects. I have a NavMeshAgent moving randomly throught the scene, then I have a sphere collider inside a children to detect nearby objects. If ...
0
votes
1answer
144 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: ...
2
votes
1answer
427 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
158 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
188 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
74 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
23 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
1answer
222 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
208 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
38 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
164 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
23 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 ...
2
votes
1answer
1k 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
25 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
1k 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
21 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
281 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
291 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
67 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
436 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
2answers
1k 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
400 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
120 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
369 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
22 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
117 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
225 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
88 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
44 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
251 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
498 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 ...