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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

How to rotate a players movement axis as camera switches? (Not used to coding)

I am using unity and I have two cinemachine cameras with two seperate camera angles. For one camera angle I want the players W key to move at a 45* slant while at the other I just want it to be ...
user avatar
1 vote
0 answers
122 views

Variable has not been assigned. when i instantiate new gameobject [closed]

The variable has not been assigned. You probably need to assign the variable of the script to the inspector. but I had already put the variable into the inspector public Camera camera; public ...
user avatar
  • 115
0 votes
0 answers
11 views

Follow object smoothly + allow yaw wobble?

I'm trying to recreate the behaviour of slotcar racing cars, that are connected to the track using a pin in the front. As they travel through turns at high speeds, the rear end of the car should "...
user avatar
0 votes
0 answers
42 views

Unity - How to implement water trigger?

I want my character to change the movement mode to swimming whenever he enters Water. So I used the OnTriggerEnter to check if the other collider is my water volume, and if so, change movement mode to ...
user avatar
0 votes
0 answers
65 views

Unity HTTP webrequest is very slow on localhost

I'm working on an online game on my computer localhost. to do this I use Xampp. Anyway, my problem is that the UnityWebRequests ...
user avatar
  • 175
0 votes
0 answers
28 views

I'm getting an "InvalidOperationException" error [duplicate]

I want to develop a new football game. I placed a cube called "BallTrigger" in the player's foot area. In this way, I wrote code so that the player can shoot the ball. But when the player ...
user avatar
  • 1
0 votes
0 answers
12 views

1. How to keep stopwatch counting after change to the next scene in Unity? I attached my code below [duplicate]

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class stopwatch : MonoBehaviour { Text text; float theTime; public float speed = 1; bool ...
user avatar
0 votes
0 answers
115 views

Get C# code from Unity apk

This is the app I built using Unity. The current version of the app is 8. I was stupid enough to lose the code for version 8. Now, I only have code till version 7. This is the code which doesn't have ...
user avatar
0 votes
0 answers
35 views

Can I use Unity's free assets for commercial purposes?

i have a question, if someone is developing a game on unity for commercial purposes, can free or even paid assets be used in the game even if it is to sell the game? are assets not subject to ...
user avatar
  • 1
-1 votes
1 answer
792 views

How to make random spawn objects in unity 3D

I created an infinte runner game. I need to make random spawning obstacles ON 3D. How do I randomly spawn prefabs on the X axis using a C# script?
user avatar
0 votes
1 answer
344 views

Using Part of prefab as script parameter

I'm trying add a weapon to Eithan - the third person character. So I want to take his hand, which is part of the prefab Eithan (the weapon location) and use it in the my Player.cs script to ...
user avatar
  • 3
0 votes
0 answers
23 views

Prefabs scaling change also the original prefab

I want to work with a prefab as local and global variable? something like that. So my question is how to change a prefab scale without affecting the original prefab.
user avatar
0 votes
0 answers
44 views

unity3D Angry bird orthographic 3d approach

i want to create a game like angry birds but in orthographic mode 3D . i want to give the player the ability to Jump to the Red and Blue Platform (see the picture below) with the Click, Drag and ...
user avatar
  • 1
0 votes
0 answers
33 views

Animation for some reason doesn't trigger after death

So I am trying to trigger this explosion animation after this enemy dies, but for some reason the animation doesn't trigger. I've made sure that the explosion animation is linked to "Any State", and ...
user avatar
0 votes
1 answer
109 views

How do I account for the velocity difference between a ship and it's fired projectile?

In my project, I have a ship that moves and increases it's movement speed with respect to time and how long the acceleration button is being pushed(just like the way a real life car works), now as ...
user avatar
0 votes
1 answer
34 views

Actual Sizes of An Image loaded with a Path

I have a method which selects an Image from device. I need to show this image to users. The codes below works fine, does what I need. ...
user avatar
  • 13
0 votes
0 answers
89 views

Unity 3d Raycast from localspace to worldspace

I want a raycast direction not relative to the rotation, but what happens is that the raycast points to one place as if it was a transform.forward Why is the happening help ...
user avatar
0 votes
1 answer
463 views

How to attach main camera to script component of a prefab?

So I have a prefab which is an item drop and a timer attached to the main camera. When the player collides with the item, I need the item to destroy then add time to the timer. The itemdrop handling ...
user avatar
  • 103
0 votes
1 answer
343 views

How to raycast from a UI element

How do I raycast from a UI object? I have tried Ray ray; Camera cam; Transform obj; //UI object ray = cam.ViewportPointToRay(obj.position); AND ...
user avatar
0 votes
1 answer
321 views

Unity Bot AI behaviour

I'm working in Unity3d 2019.2.0f1 and I'm trying to make a chasing bot that follows a certain GameObject with the "Player" tag. I'm not yet attempting a field of ...
user avatar
0 votes
3 answers
1k views

Inheritance - accessing child class values

I want to use the same variable for five different child classes. It is basically a boolean that is true when a player purchases an item(represented by a child class) and false when the player is yet ...
user avatar
0 votes
0 answers
36 views

Why does my "spawnedEnemies" variable not update when enemies are destroyed?

I'm creating a shooter game and I'm trying to update the current count of enemies on screen. When the laser hits an enemy, it is supposed to subtract 1 from the "spawnedEnemies" and then destroy the ...
user avatar
0 votes
2 answers
871 views

Unity - change only z axis rotation to 0

I have a child where I want the rotation to work like (parentRot, parentRot, 0). So first I set its ...
user avatar
  • 1,863
0 votes
0 answers
21 views

NullReferenceException: Object Reference Not Set to an Instance of an Object (How is that so and I should I solve it?) [duplicate]

I am stuck several days because of this problem, which I am almost on the verge of giving up. (Using Unity Engine 2019.3a by the way). The TextButtonName.text can't read what TextButton is throwing to ...
user avatar
1 vote
1 answer
662 views

Problem with Rotation clamping in Unity

I'm trying to get a simple cannon to rotate to point at the mouse, but I only want it to follow the mouse for 180 degrees and then stop following the mouse, and pick up again when the player re-enters ...
user avatar
1 vote
1 answer
224 views

unity 3d loading data from json problem

i am trying to practice on loading data from json files my problem is about when i try to load the sprite path from the json file to load the image icon from the floder that contain it, i manged to do ...
user avatar
  • 11
0 votes
1 answer
83 views

how to reset etsa function GetJoystickNames in unity?

the problem is that if I connect a command the array GetJoystickNames increases an index but if you disconnect it does not reduce the index and continues counting as if it were connected
user avatar
0 votes
0 answers
35 views

Make players Rigibody move in direction its going?

I have my snowboard character which I am trying to fix the movement for. At the moment, The player is using transform.forward on the rigidbody to move forward. If my player turns around and faces up ...
user avatar
0 votes
0 answers
42 views

How can I deactivate and activate a button?

I have a code that keeps a gameObject between scenes, the theme is that this gameObjecte has as a child a button, which I can change the linerenderer color, besides changing the image of the button ...
user avatar
0 votes
0 answers
12 views

Issues with Flashlight Handle position with player rotation

I want the flashlight to look same while looking up and down as when looking straight. Normal Position for Hand and flashlight: Looking up and down, position is completely off: More images for ...
user avatar
3 votes
1 answer
987 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 ...
user avatar
  • 141
1 vote
0 answers
30 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 ...
user avatar
  • 111
0 votes
0 answers
60 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
0 votes
1 answer
373 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 ...
user avatar
1 vote
0 answers
50 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 ...
user avatar
  • 63
0 votes
0 answers
424 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.
user avatar
1 vote
1 answer
3k 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 ...
user avatar
0 votes
1 answer
379 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(); ...
user avatar
1 vote
0 answers
57 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 ...
user avatar
1 vote
0 answers
240 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 ...
user avatar
  • 183
1 vote
1 answer
2k 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. ...
user avatar
  • 181
0 votes
1 answer
280 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 ...
user avatar
0 votes
1 answer
2k 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: ...
user avatar
  • 2,438
2 votes
1 answer
3k 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 ...
user avatar
  • 2,438
0 votes
1 answer
497 views

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

What are the difference between Renderer.sharedMaterial and Renderer.sharedMaterials in Unity?
user avatar
1 vote
1 answer
168 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.
user avatar
  • 2,438
0 votes
1 answer
28 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 ...
user avatar
  • 2,438
0 votes
1 answer
505 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 ...
user avatar
1 vote
1 answer
2k 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: ...
user avatar

1
2 3 4 5
7