My player disappears when launching my 2D Unity game - c#

I am trying to create a 2d platformer game in Unity 5 following these tutorials: https://www.3dbuzz.com/training/view/creating-2d-games-in-unity-45
I am however running into a problem where when I hit the play button in Unity my character simply does not appear inside the game. I made sure he is on the right layer and has all of the required scrips associated to him and still no dice...
Here is a copy of my source code: https://mega.co.nz/#!4YFAVLxA!8UZieNrqI3F1--4HsaLPPfw_ICbCkG7uGZVuWAfmSyY

In the end the issue was that my main camera was not far enough on the Z axis and unity was rendering my player behind the camera!
I fixed it by setting the camera's Z coordinate to -100 instead on -10.

Related

Sprites disappear after game is built (unity engine C#) Not an issue of layer they are on

I am currently writing a 2D game in unity and whenever I build the actual game, the sprites all disappear, the player is the only thing that remains.
However, the sprites are still there, just invisible. It's not an issue of order of layer and am having trouble fixing it.
I am using SpriteShapeController.
SpriteShapeController auto shows as it having a sprite so it made me think I had a sprite already
I just made Custom Square Sprites and added them in.

Have phone rotation be camera rotation in Unity for Android?

How would one go about using the gyroscope, or whatever AR-magic or related tech Android provides, to have the phone rotation become the in-3D-scene-camera rotation? Basically, I have a scene in Unity/ C#, and when it runs on Android I want to have the user be able to view the scene as if the phone was the in-world camera, a bit like in VR. So if one rotates the phone leftways, for instance, one sees what is to the left in the 3d scene, as if one was standing inside it. Thanks!

Unity camera not properly turning

Im working on my first project in unity and I am running into a problem where the camera is not turning properly, i cannot look up or down only left and right and even then it does not turn the camera but the angle of the environment here are some screenshots of the setup of the project.[

AI in different-shaped planets - Unity 3D

I am currently working in a Unity 3D project (in version 5.0.1 to be precise) in which the character can walk in different-shaped planets without falling. So it is always attracted by the planets gravity (similar mechanic to the Super Mario Galaxy games).
Now, the problem is when I try to code the AI for the enemies. This AI should be pretty much simple, but because of this thing that I have with the planets shapes, I haven't been able to come up with a solution. The enemy should check where the player is and move ahead to its position. It's a really dumb enemy. But the thing is, that the enemy must be able to track the player and get to its position no matter what planet he is in. So, if the planet is circular, I cannot make the enemy look at the player and then move forward, as I would do in a plane planet.
I have already tried using a NavMesh, but Unity doesn't want to collaborate and ends up making a NavMesh of 1/3 of the planet. I don't understand why. I have tried changing every single parameter of the NavMesh baking but I haven't succeeded.
Another problem that I would like to do is: ¿How would you make a player be able to walk on the surface of any planet, no matter what its shape, in a smooth way while using a Mesh Collider? I am currently achieving this by getting the planet's normal with a raycast, rotating the player so that the Y axis is perpendicular to the normal and applying a force in -Y to simulate gravity. But this brings lots of problems when I implement the Mesh Collider. It results in a jittery effect. But, when I use a primitive collider from Unity, it works fine...
Anyway. What I need the most now is the answer to the AI question. The other one is kinda like a plus.
P.S: It doesn't matter if the solution is in Javascript. I can then translate it to C# :)

Goblin XNA -- Creating a labyrinth style game

Anyone know how to use Goblin XNA to implement ball control in the same way as one might find in the board game labyrinth?
There don't appear to be any tutorials or information at all regarding how to do this, despite there being a demo video displaying just such a thing.
I've setup the environment and gravity and added the ground and a sphere. I use WorldTransformation.Decompose to extract the current orientation of the board. I know the next step will be either ApplyLinearVelocity or AddForce to the sphere based on the current board orientation, but I don't know how to constantly apply these methods to the ball so that the ball is moving in response to the movement of the ball. Adding code to the Draw or Update methods only executes the code a single time. Anyone familiar with Goblin XNA at all and able to help?
As far as I can see in Goblin XNA the Update and Draw methods are called the same way as standard XNA games. Can you give more specific information? source code perhaps?

Categories