Quantcast
Channel: Latest Questions by Max 4
Browsing index pages (60 articles)
↧

Child objects of character controller don't collide.

I have a FPS controller with two cubes either side of it as children. When moving around, these cubes, which do have box colliders, just move straight through walls. Is there a way to stop this happening?

View Article


What would be the best way to have a blank camera?

I have a project I'm working on where I want the screen to be black until a button is pressed. I've tried disabling the camera, but that leaves the screen gray. I've also tried blocking the camera with...

View Article


How do I change a disabled camera's background colour?

I've been looking in the settings but just can't find it. When a camera is disabled, it shows just a blank grey screen. I want to change that colour that it displays. Where can I do that?

View Article

One scene doesn't run, but no error comes up

My logo scene, menu scene, and instruction scene work fine. But when I click play on the menu, or run the scene that contains the actual game, it just freezes. When I try to run the scene, it goes into...

View Article

What can cause Unity to crash?

I recently made some changes in my ammo drop script. Now, if I run the game with enemies enabled, it freezes up. If I deactivate my spawning system, it runs fine. I'm fairly certain that is has...

View Article


NullReferenceException about rigidbody tags

I am constantly getting a NullRefenceException on one line if(collision.rigidbody.tag != "ground") I don't know what's wrong with it. I have tried changing everything, but it just doesn't work. There...

View Article

Making an object replace the cursor

For my menu, I want to replace the cursor with a particle system. I'm assuming that to do this I need to make the cursor invisible, and then make the particle system follow it. I don't know how to do...

View Article

Making a consistent jumping system

So, I have a jumping code that uses raycasts: function Update () { var direction = transform.TransformDirection(Vector3.down); var hit : RaycastHit; var localOffset = transform.position; if...

View Article


How do I generate believable terrain for a 2D game using cubes?

Ok, I have a fairly simple code that spawns a moving block. It spawns them in a range. Instantiate (defaultground, Vector3 (transform.position.x, Random.Range(0,2.5), transform.position.z),...

View Article


Spawning ground in front of the player

I have a game where my character is constantly running right. I need help in figuring out a way to make the terrain spawn just out of sight of the camera. I have an object for the default ground, and I...

View Article

Animating hinges

I have a cube, with cylinders that I want to make legs. I have given them both Hinge Joints at the point I want them to pivot around, but I don't understand what I do if I want to make an animation...

View Article

Destroy on range command

Ok, so here is my code: function Update () { transform.Rotate (Vector3 (0, 2, 0)); target = GameObject.FindWithTag("Player"); range = Vector3.Distance(target.transform.position, transform.position); if...

View Article

Colliding with a character controller

So, I have an object that I want to disappear when a FPS controller collides with it. My code doesn't work. function OnControllerColliderHit (hit : ControllerColliderHit) { Destroy (gameObject); } What...

View Article


Making a new function

I want to make a new function, but I want this function to act the same as OnCollisionEnter. How do I do this?

View Article

Making a plain number range

I know about Random.Range, but I would like to say "x equals 1 to 10", and using just Range doesn't work. What do I do? [EDIT] Hmm, ok, maybe it would be better if I explained what I wanted to do. I...

View Article


Player not deleting on server exit

So, here's a slightly altered code from the IOS multiplayer var Player : Transform; var camera1 : Camera; function OnNetworkLoadedLevel () { camera1.enabled = false; // Instantiating Player when...

View Article

Spawning above the terrain

For my multiplayer game, I want random spawning. This is what I'm using: Network.Instantiate (Player, Vector3 (Random.Range (5, 95), transform.position.y+4, Random.Range (5, 95)), transform.rotation);...

View Article


Multiplayer spawning error

So here's what I'm using: var Player : Transform; function OnNetworkLoadedLevel () { // Instantiating Player when Network is loaded Network.Instantiate (Player, Vector3 (Random.Range (5, 95),...

View Article

Multiplayer tutorial help

I am using the muliplayer tutorial, and the first code is bringing up some odd errors. Assets/connectionGUI.js(17,41): BCW0012: WARNING: 'UnityEngine.Network.useNat' is obsolete. No longer needed. This...

View Article

Making an object move with the camera

For some reason, when I child an object to my FPS controller's camera it doesn't move up and down, only left and right. Has anybody else encountered this before?

View Article
Browsing index pages (60 articles)


Latest Images