Unity Community |

Hey ArenMook,
Looks like Unity 3.5 moves the project settings from Library to a folder titled "Project Settings". Might be helpful to update the readme file to indicate this change for future users.
I am also noticing an error with Unity 3.5. I am getting an "Invalid SceneHandle" error. It states:
Error in file: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp at line: 283
Could you shed some light on this error. It seems to go away once you run the game, but reappears when you go back into the editor.
@mente: It would be a completely different style of a game. I can maybe see you starting with the arcade example and changing the camera so it's looking at the side of the ship, but to be honest with you I'm not sure how helpful this starter kit would be for you as a 2D scroller game would be a completely different game in its scope.
@pqumsieh: I've noticed odd issues with 3.5 that are completely on the Unity's side. I've submitted a bug about it a few weeks ago and haven't heard back from them. The error you're getting is inside Unity's C++ source code.
Last edited by ArenMook; 02-28-2012 at 06:51 PM.
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Hey Aren,
One more question, I was running the profiler taking a look at resource usage and I noticed 90% of resources were being used by something titled "WaitforTargetFPS".
I tried to figure out what this was doing and where it was located but I had no success. Could you possibly shed some light on this for me please?
Cheers,
Peter
That simply means that the framerate is a lot higher than 60 FPS, and it's capped at 60 due to V-Sync. Another Unity thing.
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Hey Aren,
I am really struggling to use this project with Unity 3.5. I think there are a number of conversion issues; it might be good to make a note of this within the asset store for now until things get sorted out. Hopefully Unity fixes things on their side or you find a way to fix things on your side in the near future. Really liked what you provided, but I think we will have build from scratch.
Sorry to hear that, and you're right I should mention that Unity guys are working on the fixes. What other issues are you seeing?
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
I just bought the kit and am pretty much lost trying to use the kit. I have Unity 3.5 and am new to it. Should I be able to select the Welcome Scene and play it or do I need to build with Welcome and Game scenes? It's crashing repeatedly when switching between scenes as well. I have been able to select an opening scene and play it to see how a kit works with other kits... doesn't seem to work in this case.
I did unzip and copy the library into the library folder, btw - didn't help.
@WhiteRabbit: The crashing on switching scenes is a bug in 3.5 that has been acknowledged by Unity and passed on to their devs to fix (case 443644). For Unity 3.5 you need to unzip the contents of that zip file into the ProjectSettings folder instead of Library (they changed it in that version). For building, you need to build it with Main and Game scenes selected. For playing, start with the Welcome screen (although you can start with the game scene right away, but it will be single-player only).
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Ok, I copied the library zip contents into the ProjectSettings folder and now the Game scene can be played as a standalone. However, trying to play the Welcome Screen scene and clicking on "Host Game" does nothing. The Welcome dialog disappears briefly and pops up again. As an aside, I have the Photon server that I'm using with a non-Unity project and would like to use it within this demo.
If clicking on Host Game does nothing then it sounds like it's failing to load the scene or start the server. Check your build properties, make sure that the Game scene has been added there. Are you getting any error messages? The game works fine for me when I start it via the Welcome screen on 3.5.0. Switching the scenes in the editor crashes Unity (that's the case 443644 bug I mentioned that Unity has to fix). I also get "Invalid scenehandle" error as soon as the game scene loads. Cryptic, reason unknown. The kit runs perfectly on 3.4.2. 3.5.0 has been far less stable in my experience.
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Hey Aren,
I am starting a new project but want to move over some of your work. I tried to compile the Spaceship, SpaceshipController, and FaceTarget script into a new script called PlayerController. However, the player movement is laggy causing the scene to appear to jitter. I tested to make sure this is the case, I imagine I have done something wrong to cause this.
I removed the mNavigator and replaced it with generator.powerPercent. I tried to get rid of as much network script as possible and maintain just the basics. Could you take a look at the code and let me know if there is anything apparently wrong with it? I've been trying to figure out the jitters with no luck so far.
Code:
using UnityEngine; using System.Collections; { public PowerGenerator generator = null; public float maximumSpeed = 150f; public float mainThruster = 1f; public float maneuveringThrusters = 1f; public float turnThrusters = 1f; public float rotationSpeed = 5f; public float inertiaDampeners = 0.15f; public float boost = 2.0f; Rigidbody mRb = null; Transform mTrans = null; Quaternion mCurrentRot; public bool movement = true; Quaternion rot; // INFO: Used in FaceTarget script float mAppliedThrust = 0f; // Amount of thrust currently applied in any direction //float mVelocity = 0f; // INFO: mVelocity was used by currentSpeed to display the current speed of the player on the HUD /// <summary> /// Relative -1 to 1 range movement input. /// </summary> // Use this for initialization { mRb = rigidbody; mTrans = transform; if (generator == null) { generator = GetComponentInChildren<PowerGenerator>(); } } // INFO: FixedUpdate runs the player movement script { // TODO: Add in PlayerMovement here PlayerMovement(); } // INFO: Control input is handled within Update { if (movement) { } // Ensure the vector is unit length float mag = move.magnitude; if (mag > 1f) move *= 1.0f / mag; // Set the ship's values this.moveInput = move; // INFO: Makes the player face the central enemy structure, smoothly handles rotations { { dir *= 1f / size; { } else { } } rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY; } } { // INFO: Tries to smooth the force applied to the player, refer to PlayerMovement; // I use it in mAppliedThrust to determine the amount of thrust applied to the player. } // INFO: Handles the forces that get applied to the player void PlayerMovement() { // Ensure that we are not traveling faster than we are allowed to // 3600 seconds in an hour, but 1000 meters in a km, 3600/1000=3.6 { vel *= maximumSpeed / speed; mRb.velocity = vel; } // Amount of thrust being applied right now - mSmoothMove = Vector3 // DONE: Multiply mSmoothMove.magnitutde by the current percent within the power generator mAppliedThrust = mSmoothMove.magnitude * generator.powerPercent; // No point in doing these calculations if the engine is idle if (mAppliedThrust > 0.001f) { // Object's current local velocity // Not sure why he is inversing the GObjects rotation and multiplying it by its velocity float dampenerPower = (generator != null) ? (0.25f + 0.75f * generator.effectiveness) * inertiaDampeners : 0f; // mMove = Vector3 // INFO: Manually modifying each individual value within mMove and applying it later into appliedForce // TODO: Play around with the controls scheme; ensure we are using forward, right, up correctly float up = mMove.y * maneuveringThrusters * 0.25f; // Calculate the force we want to apply to the ship // Normalized direction of the applied force float mag = appliedForce.magnitude; // INFO: Force direction = either appliedForce * (1.0f / mag) or Vector3.forward // Applied force should take the current engine's power into account appliedForce *= generator.powerPercent; // This is how much of velocity is currently what we need it to be: // Q: What does this do? // Dampener power depends on inertia dampeners strength as well as the current speed dampenerPower *= 0.15f * speed / maximumSpeed; // This is the incompatible velocity (for side dampeners) // If we're traveling in the opposite direction, we want to slow down first (in addition to the engine's force) if (dot < 0f) dampeningForce += vel * (dot * 0.1f * dampenerPower); // Apply the force and the incompatible velocity together { generator.DrainPower(10); } } //INFO: mVelocity was used by currentSpeed to display the current speed of the player on the HUD //mVelocity = Mathf.RoundToInt(mRb.velocity.magnitude * 3.6f); } }
Thanks,
Peter
Jitters are caused by the camera moving in Update while the ship is moved in FixedUpdate (physics). I fixed it in the space game by adding a LagPosition script in-between of the two. It smooths out the jaggies, making them invisible.
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Thanks for the reply Aren, I think we fixed the issue. I really appreciate your quick feedback and help; I've passed the word on about your starter kit as a thanks.
Peter
Aren,
Could you further explain how you implement LagPosition? Where is it called? I see that you use ChaseCamera to handle this movement.
Cheers,
Peter
Simple hierarchy of 3 game objects:
- Rigidbody
--- LagPosition
------ Camera
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
The camera is a child of the player, I have attached lagPosition and LagRotation to the camera. Is there a step I am missing? It still jitters at this point. I also do not have your update manager incorporated but by looking at the script it doesn't seem to be referenced within lagposition/rotation.
Peter
Last edited by pqumsieh; 03-02-2012 at 01:08 PM.
Chase camera simply chases a target, and I believe it has similar code to lag position. LagPosition is just more flexible and more generic. (can't look at the code right now)
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
Just got back to this - Open the project, double-click on welcome screen - always crashes now, so can't add the scene to the build through the Add Current button. 3.5.0 has been out for quite a while - when are they planning to fix this? is it necessary to build the project or can the welcome scene simply be played? I don't really understand the difference between playing a scene and doing a build - the documentation for Unity isn't the best.
At this point, I've payed $60 for nothing, since it's not usable in its present form and I was hoping to use the starter kit to begin to learn Unity. Will probably have to start over from scratch on the project and hope I can get back to being able to load the welcome scene. Is 3.4.2 still available and, if so, what are the differences?
Unity 3.5.1 RC1 is currently out for testing, I'm hoping it addressed this issue but I haven't had a chance to test. 3.4.2 is much more stable than 3.5.0, if you can grab it and use it, I would suggest you do so. None of the features they added relate to the space game kit at all, so from my perspective 3.5.0 was just a step back rather than forward.
NGUI Resources: Documentation | Forum | Release Notes
Want to get notified when NGUI gets updated? Subscribe to this thread.
No luck in trying to find 3.4.2. Clicking on its link takes me to the 3.5 download page.
After reloading the project, build options include all 3 scenes -- all grayed out and uncheckable. It's crashing every time that I double-click on the Welcome scene.
So -- the kit is unusable as is with 3.5.0, 3.4.2 seems to be unavailable and the status of 3.5.1 is unknown. My earlier question remains as to whether I should be able to run the kit without compiling by playing the Welcome scene. If I have to compile, how do I do so when all scenes are unselectable in the build dialog?
If 3.5.1 RC1 is out -- how does one get a hold of it?