spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » UNITY3D » Page 1
When is a referenced texture actually loaded?
You can test this. You create a gameobject with a script on it has the reference to the texture as public variable and disable the gameobject. Then you create another gameobject that also has a script an tries to access the reference to the texture in the other script. E.g. I did a little test with a prefab. Gameobject 1, disabled and with this script attached to it: using UnityEngine; using Sys

Categories : Unity3d

Unity - Using button to touch control
OnClick is an event and is called when a click event occurs. If you wan't your object to rotate while the mouse is pressed and over a gameobject use: 1. Input.mouseButtonDown and check if the mouse is over your object 2. OnMouseDown() in a script attached to your object (this will automatically check if the mouse is over your object) 3. for the new UI elements use the EventSystem and check if you

Categories : Unity3d

Using leapmotion to control Unity3d interface
Yes, it is possible, but requires some scripts that nobody has written yet (ASFAIK). Here is a VERY rough example that I worked up today since I've been curious about this question, too. All it does is move, scale, and rotate a selected game object -- it doesn't try to do this in a good way -- it is a proof of concept only. To make it work you would have to do a sensible conversion of Leap coordi

Categories : Unity3d

Use c++ Code in Unity3D
did some googlefu... C++ is not a scripting language, and can only be used with Unity in the form of plug-ins (in the Pro version). C# is closer in syntax to C++ than Javascript is. http://answers.unity3d.com/questions/12809/can-i-use-c-as-a-scripting-lanques-for-unity.html (couldn't find anything that contradicted that) although these might be of interest: http://gamedev.stackexchange.co

Categories : Unity3d

Rotation on object pivot Y axis [UNITY]
new Vector3(0,1,0) is "world space" up (same as Vector3.up btw). Easiest way to get to the "local space" up would be to use transform.up http://docs.unity3d.com/ScriptReference/Transform-up.html

Categories : Unity3d

Apply Physics2D to 3D Game Objects - Unity3D
It is not, however what you can do with rigidbody3d is lock the physics movement and rotation on it. For example, if you only ever wanted it to move along the x and y axis of your game, in the inspector just tick the freeze z movement box for the rigidbody component.

Categories : Unity3d

unity2d rotation of a gameobject along z axis
One way: Vector3 oldMousePos; void OnMouseDown() { oldMousePos = Input.mousePosition; } void OnMouseDrag() { Vector3 diff = Input.mousePosition - oldMousePos; oldMousePos = Input.mousePosition; float angle = diff.x * rotationSpeed; transform.Rotate(Vector3.forward, angle); } Another way void OnUpdate() { float angle = Input.GetAxis("Mouse X") * rotationSpeed; tran

Categories : Unity3d

About unity 3d load assetbundle difference
Unity doesn't support loading bsdiff'ed files, but you could implement it yourself. Example: // Load asset bundle WWW www1 = WWW.LoadFromCacheOrDownload("original.bundle"); // Load diff WWW www2 = WWW.LoadFromCacheOrDownload("updated.bundle.diff"); // Get bytes for both assets byte[] original = www1.bytes; byte[] diff = www2.bytes; // Apply diff byte[] updated = ApplyBspatch(original, diff); /

Categories : Unity3d

Method to know the Unity version of an Unity project?
You can use preprocessor directives #if UNITY_4_5 Debug.Log("this is Unity 4.5"); #endif http://docs.unity3d.com/Manual/PlatformDependentCompilation.html

Categories : Unity3d

Make multiple enemies follow on trigger Unity
You can change the type of the agent variable from NavMeshAgent to array of NavMeshAgent. In the editor you can set the size of the array and then assign all the enemies you want to react. Then you can iterate over them and update them all. This is what it looks like: #pragma strict //script by Kyle Crombie & Paul Christopher //will add negative action if collision is detected with player v

Categories : Unity3d

Unity2d vertical movement logical error
Y is the vertical co-ordinate but you refer to it in the horizontal call. You just need to swap the .x and the .y around. edit: Sorry rushed my answer, you need to swap the x and why, and also swap your Vector parameters, so: void FixedUpdate () { float move = Input.GetAxis ("Vertical"); rigidbody2D.velocity = new Vector2 (moveV * MaxSpeed, rigidbody2D.velocity.y); float moveV = In

Categories : Unity3d

The right time to destroy an interstitial ad
It really depends on how you're handling the ad. If the reference to the ad is a member of a monobehaviour class, you could call ad.Destroy() on the script's OnDestroy. If it's a local variable inside some method, then you have to call ad.Destroy() before leaving the method.

Categories : Unity3d


Recently Add
How to capture current desktop efficiently and cross-platform in Unity3D?
When is a referenced texture actually loaded?
Unity - Using button to touch control
Using leapmotion to control Unity3d interface
Use c++ Code in Unity3D
Rotation on object pivot Y axis [UNITY]
Apply Physics2D to 3D Game Objects - Unity3D
unity2d rotation of a gameobject along z axis
About unity 3d load assetbundle difference
Method to know the Unity version of an Unity project?
Make multiple enemies follow on trigger Unity
Unity2d vertical movement logical error
The right time to destroy an interstitial ad
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.