unity5

How can i change each gameobject movement speed?

与世无争的帅哥 提交于 2019-12-04 07:23:46
问题 In the Hierarchy i have 2 ThirdPersonController. In the Window > Animator i created new empty state called it Walk and set it to HumanoidWalk so when running the game both players are walking. On one of them i added the script and as Prefab the second ThirdPersonController(1). Then when running the game it's making clones of the ThirdPersonController(1). So i see in the Hierarchy more N ThirdPersoncontrollers. Today to change the speed of walking for each ThirdPersonController i change in the

Create a health bar

喜夏-厌秋 提交于 2019-12-04 07:02:36
问题 I am trying to create a working health bar, and I have tried methods like Creating GUI.Box() that contains the health bar texture that I have created, but this makes the health bar resize to scale like this: Resizing the texture itself without the GUI.Box(), using the Texture2D.Resize() Method, but when I used the Texture2D.Resize() method, my texture turned black . It looks like this: My code looks like this. It was edited so that the irrelevant parts were deleted for ease of reading. Why

Unity 5 unresponsive after a piece of code is executed

不羁岁月 提交于 2019-12-04 05:06:51
问题 I am a absolute beginner in unity. I have been working on an UI which is a simple login form. In which I have two Toggle for selecting gender i.e male or female. What I have been doing is that calling a method which checks if a male is already selected it will remove the check from male when the other toggle is pressed. My Unity freezes when I click the female Toogle . here is my code. Toggle female; Toggle male; void Start(){ female = GameObject.Find ("toggle_female").GetComponent<Toggle> ()

Equivalent of SKAction scaleToX for a given duration in Unity

假装没事ソ 提交于 2019-12-04 04:41:37
问题 I am trying to scale the x axis of a sprite over a given duration in Unity. Basically I've done this before using Swift in the following way, let increaseSpriteXAction = SKAction.scaleXTo(self.size.width/(mySprite?.sprite.size.width)!, duration:0.2) mySprite!.sprite.runAction(increaseSpriteXAction) mySprite!.sprite.physicsBody = SKPhysicsBody(rectangleOfSize:mySprite!.sprite.size, center: centerPoint) but haven't even found an equivalent for scaleToX in Unity. I'll really appreciate some

Unity3d editor: how to prevent changes from being undone upon exiting play mode?

家住魔仙堡 提交于 2019-12-04 01:54:41
问题 Apparently this is some beginner's question (and that I am) but it's driving me crazy and I couldn't find any mention: I Occasionally forget to exit Play mode and go on building my UI making objects and changes, only to realize that I'm still in Play Mode and as soon as I unpress the play button, these will be purged! I suppose the Unity Editor has its reasons for allowing editing of Scripts/Scenes while in Play Mode (would be happy to hear some examples-maybe testing scenes?) but my main

GameObject update order in Unity

*爱你&永不变心* 提交于 2019-12-03 17:34:32
The Unity Manual describes the order in which the Script functions are called. However, I was wondering if there were any rules regarding the order in which the GameObjects themselves are considered in Unity. GameObjects are basically the nodes of Unity's scene graph and (assuming the scene itself was the root node) they form a tree. I was wondering if that tree structure imposed any rules on the order in which GameObjects are considered. As already mentioned, the manual describes that Awake() is always called before Start() which is always called before the first call to Update() and so on.

Xbox one dev mode and Unity free version

南楼画角 提交于 2019-12-03 15:15:54
I have a retail Xbox one console with Dev Mode activated Unity (latest free version) and a MSDN individual developer account. I am able to deploy test apps from Visual studio on the Xbox however i want to know how do i build and run apps on Xbox from Unity? I contacted unity and they said i need approval from my account manager however I'm an individual developer. What I want to do is deploy from Unity to Xbox one I'm running parallel from a Mac (Windows 10 version) but Unity is installed on my Mac. After some research here is a way to run a Unity built app on a retail XboxOne Developer

OpenCV + Android + Unity

二次信任 提交于 2019-12-03 01:13:57
问题 I am looking for a way to use OpenCV in a Unity project and my target platform is an Android device. I know that some assets exists on Unity asset store but I DO NOT want to use them as I find them way too expensive. I manage to use use opencv in Unity as a C++ native pluggins by precompiling OpenCV in dlls using this tutorial, but dll means Windows Desktop so it doesn't help me much to build my project for Android. I also found opencv jar archive, I know they can be easily imported into

Unity 5 An object reference is required for the non-static field, method, or property error

邮差的信 提交于 2019-12-03 00:11:09
问题 In Unity 5 using c# on line 35 of my PlayerMovement class I have this error: Error CS0120 An object reference is required for the non-static field, method, or property 'GameManager.completeLevel()' PlayerMovement Class: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public GameObject deathParticals; public float moveSpeed; private Vector3 spawn; // Use this for initialization void Start () { spawn = transform

OpenCV + Android + Unity

為{幸葍}努か 提交于 2019-12-02 16:32:12
I am looking for a way to use OpenCV in a Unity project and my target platform is an Android device. I know that some assets exists on Unity asset store but I DO NOT want to use them as I find them way too expensive. I manage to use use opencv in Unity as a C++ native pluggins by precompiling OpenCV in dlls using this tutorial, but dll means Windows Desktop so it doesn't help me much to build my project for Android. I also found opencv jar archive, I know they can be easily imported into Unity, but I don't know how to do the next step: that is how to access OpenCV stuff from Unity C# scripts.