Unity 5 - Roll a Ball game - 5 of 8: Creating Collectibles - Unity Official Tutorials
Problem:
Material doesn’t apply its self to the prefab i.e. I drag the material onto the prefab object, but it does not apply the material to the other duplicates(pickups)
Also if I try applying material directly onto a pickup and clicking apply, it doesn’t change the rest of the instances when I try to apply. Whats happened?
When I hover over the apply button , I get the warning that "You have broken the prefab connection… " Also “GameObject reference missing”, but this script warning has existed since the tutorial and things seemed to work until now.
There is no problem with the pick ups rotation or ball movement.
!(http://Unity 5 - Roll a Ball game - 5 of 8: Creating Collectibles - Unity Official Tutorials)
can anyone help me , im using microsoft vs here is the code
here is the error
Severity Code Description Project File Line Suppression State
Error ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index Solution ‘ROLL A BALL’ (1 project) /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs 633
the prefab for the pickup that you have in the prefab folder will be used as the template for all the pickups.
so any changed to that will propogate through to all instances of that prefab in the scene.
so dragging that pickup from the prefab folder into the scene will create an instance of that prefab, and will be bound to it.
check your pickup prefab in the prefab folder, you seem to have a missing script in the inspector. so highlight your pickup in the prefab folder and delete the missing script that might be causing some issues.
drag a copy of that prefab into the scene and see how it looks after clearing any missing script errors.
can you double check that the script is attached to the player please.
can you also check that the rigidbody component that is on the player does NOT have the ‘isKinematic’ box checked.
are you getting any errors showing in the console?
if that doesnt sort it, can you please post a copy of your PlayerController script so we can have a look (using code tags please to make it easier to read, see sig for help)
i have restarted it many times but keeps pulling up this code , normally it will start with no error in vs , but after trying to add it to the player it will pull this code, ive deleted the script started it IN VS over again , tried deleting the project and restarting it
Thank you for the tutorial. Everything works, however I haven’t compiled it into a standalone app. I wanted to know I’d add sound effects for when the ball hits a cube. Perhaps looping background. Just a thought. Thanks again & I look forward to more tutes.
I’ve got a problem with making this simple game work. Every time I try to test my movement script, this pops up in the console: Screenshot by Lightshot
I’m not sure how this is going wrong, but, I have a few ideas of where the problem could be sitting, as seen in these screenshots.
And the mover script is here under this spoiler.
Code (under spoiler to reduce space that has to be scrolled by).
using UnityEngine;
using System.Collections;
publicclassPlayerController:MonoBehaviour{
publicfloatspeed;
privateRigidbodyrb;
voidStart()
{
rb=GetComponent<Rigidbody>();
}
voidFixedUpdate()
{
floatmoveHorizontal=Input.GetAxis("Horizontal");
floatmoveVertical=Input.GetAxis("Vertical");
Vector3movement=newVector3(moveHorizontal,0.0f,moveVertical);
rb.AddForce(movement*speed);
}
Also, while running debug in Monodevelop, this interesting tidbit popped up too: Screenshot by Lightshot.
My canvas is several times bigger than it should be, the bottom right corner of it is at 0, 0, 0, and my text won’t display in game view. Please help, I can’t find anything about this anywhere else.
This is the error code i get after assigning a playercontroler script… need help in fixing this NullReferenceException: Object reference not set to an instance of an object PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:19)
Hi, I’m a bit confused, mixed up new knowledge; I’m currently working now with space shooter; I’m just here to ask…
What’s the difference between other.gameObject.CompareTag(" “) and other.CompareTag(” ")? Same apply with other.gameObject.tag == " " and other.tag == " "?
Are they the same?