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

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#"

0
votes
0answers
11 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
35 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 ...
0
votes
1answer
17 views

Unity Monodevelop problem

I am developing games in unity but I have encountered a problem. After doing unity update I can't find Monodevelop. please help
1
vote
0answers
23 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
19 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
46 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
51 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
24 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
21 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
330 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
38 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
228 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
44 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
75 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
251 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
78 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
120 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
186 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
125 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
35 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
147 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
829 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
22 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
899 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
20 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
220 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
244 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
64 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
362 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
697 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
335 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
111 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
287 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
21 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
71 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
186 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
74 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
39 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
189 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
401 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
615 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
152 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
451 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.