Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » HELP » Help (General) » Strategy Camera to FPS Camera (C#)

Strategy Camera to FPS Camera (C#)

Go down  Message [Page 1 of 1]

1 Strategy Camera to FPS Camera (C#) on Fri Jul 31, 2015 3:48 pm

GorumGamer


Member [Lv. 3]
Member [Lv. 3]
Alright, so i got this going for me, but I get this error, which argument am i missing?
I want my button "Play" To, on click, spawn my player, any help? Thanks!
Error:
Assets/Scripts/BuildingManager.cs(31,25): error CS1501: No overload for method `Instantiate' takes `4' arguments
Script:

void OnGUI() {
//Making a button background
GUI.Box (new Rect (0, 10, 300, 900), "Buildings");
for (int i = 0; i <buildings.Length; i ++) {
if (GUI.Button(new Rect(Screen.width/20,Screen.height/15 + Screen.height/12 * i,100,30), buildings[i].name)) {
buildingPlacement.SetItem(buildings[i]);
}
}
//Making a clickable button that allows the player to spawn himself
if (GUI.Button(new Rect(95,600,100,30), "Play")) {
Instantiate(playerPrefab, spawnObject.position, Quaternion.identity, 0);
}
}

}

View user profile

2 Re: Strategy Camera to FPS Camera (C#) on Thu Aug 06, 2015 9:14 am

Sewmina


Member [Lv. 2]
Member [Lv. 2]
The Problem Is You Put 4 arguments to instantiate statement what did you mean by "0" variable

View user profile

3 Re: Strategy Camera to FPS Camera (C#) on Thu Aug 06, 2015 9:51 pm

GorumGamer


Member [Lv. 3]
Member [Lv. 3]
Not sure, used a blimey converter. I will try removing that and get back to you.

View user profile

4 Re: Strategy Camera to FPS Camera (C#) on Fri Aug 07, 2015 1:25 am

GorumGamer


Member [Lv. 3]
Member [Lv. 3]
After fixing things, an area to select my player prefab does NOT appear in the inspector. Any help?

View user profile

Sponsored content


Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum