Questions tagged [unity-components]

Components are scripts added to a GameObject in Unity3d.

In Unity you can create GameObjects in a scene and attach scripts to them that include game logic and extend MonoBehaviour. A script is written in C#, javascript or boo and becomes a component when attached to a GameObject.

44 questions
0
votes
2 answers

Why does Camera in unity not available in the next scene?

I have a start scene which has a start button. The start scene has a Camera adaptor gameobject. Camera adaptor gets main camera and performs some operations on every scene. When I click on start and the next scene is loaded, the camera adapter…
Kiran Cyrus Ken
  • 379
  • 1
  • 3
  • 17
0
votes
1 answer

GameObject (Prefab object ) created by script does not appear in Game View but appears in Scene View in Unity3d

I created a pin object by script attached it to a sphere object . using UnityEngine; public class InstantiateMarkerPin : MonoBehaviour { public float Xpos; public float Ypos; public float Zpos; public GameObject…
Jerry Abraham
  • 103
  • 12
0
votes
1 answer

Is where any Unity networking?

I started to develop a Unity-based game. I thought it needs networking. But when I try to add any networking component, I couldn't find it. Screenshot: I heard something about introducing a new system, but what to do now? Is there any analog? If…
ISD
  • 984
  • 1
  • 6
  • 21
0
votes
1 answer

How to animate an object from World canvas to Overlay Canvas

I have a bar on the top of my game with some objects plus the game score, pretty basic and usual. I have some coins (similar to Mario's game) that I would like to animate from the world canvas to the top of my bar that is in a canvas overlay. By…
Neliosam
  • 73
  • 11
0
votes
1 answer

Unity grid system woes (How to make grid that auto-collapses to column in portrait mode

My problem is very difficult to describe, so hopefully (with the pictures I provide) someone can help me figure this out. If you are confident you can fix it, I'm willing to pay if I have to. I need this fixed. I cannot for the life of me figure out…
Joel Hager
  • 2,990
  • 3
  • 15
  • 44
0
votes
2 answers

Using components from a linked gameObject in a script

Sorry if this is too simple, but i've not been able to find an answer on this. Usually either the question is too complicated to answer or too simple to not know. THIS IS PARTIALLY A UNITY VR/VRTK ISSUE (maybe...) Anyways, my goal is to set up…
0
votes
1 answer

Dynamically creating a CustomEditor class in Unity / C#

I am trying to implement edit-mode scripts in my Unity project. The idea is that a script can be attached to an object and as it's edited, attributes like scale/position/rotation can be seen updating. Without writing an edit mode script, all this…
max pleaner
  • 26,189
  • 9
  • 66
  • 118
0
votes
4 answers

Add particles on button click in unity

I am new to unity 3d, I have to do some enhancement in exiting project.. if user choose correct option then I have to show some particles around the button at runtime. My code for adding particles is below ..not working: ParticleSystem ps =…
Nibha Jain
  • 7,742
  • 11
  • 47
  • 71
0
votes
1 answer

Applying Rigidbody force to Unity components

I have a NGUI sprite, NGUI label and Rigidbody component attached to my gameobject. When I apply force to the rigidbody of my gameobject, only one of the components is affected. If I have both the components enabled, then force is applied to the…
mukul
  • 171
  • 1
  • 15
0
votes
1 answer

I have error in collision on bullet shoot

I have a problem on the bullet collision the enemy I am using the OnCollisionEnter() method in the Bullet Script Bullet Script : public class BulletScript : MonoBehaviour { public float TimeForDestory = 10f; public float Speed = 0.5f; // Use…
0
votes
1 answer

Visual component, get fed information or gather information?

I have two components, the core component and the visual component. The core component does all the game logic and does all the client/server computing. This component is always on the object, both client and server side. Then I have the visual…
Vapid
  • 701
  • 7
  • 27
0
votes
1 answer

Unity prefab with script gets different components in children than other scripts

In Script Foo, I instantiate prefab Bar which has 3 children. From Script Foo I update a script on each of Bar's 3 children and set their variable X. When debugging I can see that all this is happening correctly. Script WTF is attached to prefab…
0
votes
1 answer

Unity modify component property after collision

I'm trying to modify a property of a class component after collision, but the property doesn't seem to be set. void OnCollisionExit2D (Collision2D myCollision) { Debug.Log ("OnCollisionExit2D in Player:" + myCollision); CompoMyClass compo =…
1 2
3