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 [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
0answers
3 views

Using single Triggers on multiple controllers in Unity

After trying out a lot of stuff I finally need to surrender. Im having a project where I want to use the triggers of the Xbox Controllers seperately. To do so I added them as axis 9 and 10 in the ...
1
vote
0answers
12 views

Object pooling in Multiplayer Game. Physics not synchronizing well

I implemented object pooling for my multiplayer project. Following Unity Manual I used custom spawn handler for shooting bullets. Bullets game object has rigidbody so selected Sync Rigibody 3D in ...
0
votes
0answers
15 views

How would I swap a character when a player touches a collider?

I wrote a simple script to attempt to do this and I created an empty game object and applied the script to it and dragged both of my sprites into my script and I receive no errors but nothing happens ...
0
votes
0answers
10 views

Unity Physics Simulation - Limitations / Inaccuracies? Bounciness of a ball (pool/snooker balls etc)

I am playing with Unity physics engine. I have a pool table and a cue ball. Both have Physic Materials. If I start the game, with the ball floating about 1m above the table, it falls and bounces (...
0
votes
0answers
10 views

Making first person animations for multiple hands

I'm a bit stuck in how to achieve a basic FPS Controller/System. What I want to achieve is the following: Rig and animate first person hands with gun attached in Blender (got that) Export ...
0
votes
1answer
24 views

Does it make sense to export and use skeletal animation as sprites?

As tools like Dragonbones, Spine lets you export animations as both sprite atlas and skeleton data (JSON/binary), I'm not sure which format to use when importing to Unity. I have few concerns: Will ...
0
votes
1answer
28 views

How to reset the score to 0 when reloading the game?

My scoring system uses DontDestroyOnLoad to persist between scenes: ...
0
votes
1answer
19 views

Unity FPS style turning

I have this code: ...
0
votes
0answers
12 views

Initialize an object in property drawer based on an int variable in Unity

I have created following classes for my game in unity: ...
1
vote
1answer
18 views

Unity right mouse drag turn

How would I use my right mouse button to turn a player character in unity, while only turning in the direction and speed of the drag? Not sure if I'm meant to post this here or stackoverflow. EDIT: ...
0
votes
0answers
6 views

OnInspectorGUI Never called

The following code doesn't work, "What" is never logged out. ...
0
votes
1answer
36 views

Press f to interact with NPCs or objects

How do I change the method used for initiating the interaction. Instead of clicking object, check if within a certain radius of an object when you hit a key on your keyboard. If within 1 unit, the ...
0
votes
0answers
9 views

Help with Enemy pursuit script or follow player, endless runner type

Someone Should help me with a Script or code to integrate enemy to pursue player and then lag behind in speed, and if player speed reduces, it will catch up, like the normal enemy purse mechanics ...
0
votes
3answers
40 views

How to add collision to this script in Unity

I Want to be able to have collision were my player can't go through objects with colliders un Unity but I don't know how to make that happen, can you please help? ...
2
votes
0answers
21 views

How to properly write “stick to surface” character logic that handles unexpected large time deltas?

I've been trying to wrap my head around this issue: in a 2D platformer game (but this may as well apply to 3D games) I want the character to "stick" to the surface that it's moving along and at the ...
0
votes
0answers
18 views

Use SVG or bitmap images?

currently I'm creating a GUI for my first game in Unity and I'd like to know if I should use SVG-files instead of bitmap images. The reason why I ask is Unity seems to have some kind of SVG importer (...
0
votes
0answers
8 views

How to give and remove authority of an object between multiple clients (Or how to let the client controller push a rigidbody)

Just a little script to help anybody searching how to pass authority from a client to another when colliding with an object. I used it to let the player push a rigidbody cube with his rigidbody ...
0
votes
0answers
7 views

Export GameObject to IFC file fomat

I have some max model (fbx) object and some unity primitive objects. A user can view it in a unity player. Now i want to provide a feature to end user that they can export the unity game object to ...
0
votes
0answers
17 views

Animate character to walk beside NPC or object

I found a tutorial on youtube which is interacting with NPC and Items. My question is, how can I animate my character once the NPC or item is click. I want the character to move forward to the NPC or ...
-1
votes
1answer
41 views

How to use JavaScript language in unity?

I recently read somewhere that the unity engine supports JavaScript language but I have a question. How to use JavaScript language in unity engine?
0
votes
1answer
8 views

How do I override a SteamVR Controller's transforms in Unity?

I'm trying to provide an illusion to the user by rotating the controller about an arbitrary axis in the LateUpdate() method. But this doesn't seem to be having any effect as the controller probably is ...
0
votes
1answer
27 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 ...
0
votes
0answers
12 views

Unity - export package - but on import, scene and folder structure are different (screenshots)

I export a package and shows me all the files I am exporting. When I go to import this package, one of the files is renamed and placed in a folder that no longer exists. Can anyone explain what is ...
0
votes
0answers
13 views

Unity C# Help With Distance Based Spawner

I am having issues creating a spawn system that relies on the distance of the last object spawned from the spawnpoint. I do not want to use a timer to determine when the next object is spawned but ...
0
votes
1answer
39 views

Enemy doesn't fire at player

My script looks pretty good but it says Target variable has not been assigned value. ...
0
votes
1answer
17 views

Make Unity GUI for mobile phones only?

I'm using Unity and I want to make a responsive GUI for portrait resolution only. Now I'd like to know if this is a good or bad idea when I force the user to play my game in portrait mode only. Shall ...
0
votes
1answer
17 views

Not getting proper height in unity when android device has notch or navigation bar on screen

Screen.height is not giving the proper resolution of an Android device when that device has a notch or navigation bar. Due to this there is offset at bottom of ...
0
votes
1answer
32 views

Where do components get added in Unity?

In unity's GameObject class, there are a few default data members. When we add a component to the game object, light for example, where exactly does it get added? Does it become a part of the ...
1
vote
0answers
27 views

How to make the hidden edges to be rendered as dashed lines and remove unnecessary diagonals in Wireframe shaders?

I am currently working on the wireframe shaders which is working. I managed to have some sort of dashed wire whenever the the edges is hidden from the view but I am having problem with certain views ...
0
votes
0answers
25 views

Wave spawner and word length

I'm trying to create a falling word typing game like z-type. I have used the code provided here : https://github.com/Brackeys/Falling-Words-Typing-Game In the WordSpawner.cs file, I'm trying to set ...
0
votes
2answers
61 views

Fire at enemy script doesnt work

I need my enemies to fire at me. I have a script and I think all is correct. I couldnt figure out why it doesnt work? ...
0
votes
0answers
20 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 ...
1
vote
0answers
26 views

Realistic intensity of a sun in Unity to match the outside world

I am creating an ARCore application in Unity where I want to make lighting shadows that match the real lighting outside. For this, I have made a rotational directional light that simulations the ...
0
votes
0answers
19 views

How can I make this object Instantiate in a specific position?

I have a really simple script that instantiates objects when the "enemies" object has 0 children, it should spawn in the position of EnemyT, but they fall through ...
0
votes
2answers
47 views

Pathfinding How to store data for big terrain size

I am trying to implement my own pathfinding solution in unity but cant figures out how to store data. Following is my grid class which stores height, length and neighbour tile of tile. ...
0
votes
1answer
25 views

Unity - Button still interactable even when interactable is set to false

my button can still be pressed in-game even if I set it to button.interactable = false; What I'm trying to achieve is when the Panel ...
-1
votes
0answers
31 views

Modular Program Structure

My question is, which Diagram can best express this statement "Develop a modular program structure and explain the relationships between the modules"..Project is Game development.. It's for my SDS..
1
vote
2answers
28 views

LOD culled gameobject still interacts with raycast

The camera is sort of top down and the player can move objects around, rotate them, delete them etc. I use a raycast to check what was hit when the player clicks. But some objects are culled by the ...
1
vote
0answers
21 views

Restrict object movement inside irregular shaped container

I want to restrict object movement inside an area. My object follows cursor position. I have already done that for the area border using Mathf.Champ to the translate because the borders are square ...
0
votes
0answers
15 views

Writing an underwater wave water refraction shader

While there are plenty of online tutorials out there on underwater effects very few of them help with creating the effect of being near the surface where volumetric rays are cast down and when you ...
1
vote
0answers
37 views

Unity : How to detect if a UI button is pressed down?

I want a UI up arrow button to be able to detect if it is pressing down. It is a child of a canvas in a 3D scene. My target platform is webGL for both desktops and mobiles. I coded not only the ...
0
votes
0answers
11 views

Need Help implementing Perforce depot or GitHub repot that allows offsite cloud hosting with onsite primary server syncing between local machines [closed]

Essentially, I have been working towards finding a simple solution using either perforce or GitHub desktop or a combination of the two. I would like to create a repot/depot on a GitHub server or ...
0
votes
1answer
128 views

How do I slow down time without affecting the player? (shortened question to ONLY the code and its bugs)

how do i slow down time without slowing down the player as when i tried to implement my own version ...
0
votes
1answer
31 views

Is any Update() called always first than any LateUpdate() from other scripts?

If a script is called at a specific moment in the script execution order, will every LateUpdate() functions from the rest of the objects work after that Update()? The documentation isn´t clear about ...
-4
votes
0answers
28 views

2018: Books on MMORPG design and implementation [closed]

This question has been asked previously, however that was back in 2011 and things have moved on, so I thought to post a new question. I am looking for a book on the design and implementation of ...
0
votes
2answers
40 views

How would I apply force to a bullet in 2D?

I wrote the code below in order to try to get a bullet to fire at a specific angle for my top-down shooter. However when I press space the bullet just spawns in front of the game object despite it ...
0
votes
1answer
13 views

Enabling / disabling Static objects in Unity

The Unity docs clearly explain that game objects marked static should not be moved for performance reasons but I can't find any info regarding enabling / disabling. Almost everything in my games ...
0
votes
0answers
11 views

Ball is moving with constant velocity but not attaining same distance

I have created a Kinematic equation of calculating the velocity required to launch a ball so that it passes through a given position. This velocity is being calculated for each time ball collides with ...
0
votes
0answers
30 views

Not serialize but show them in inspector - Unity

I have a serializable class, like so: ...