Forum rules - please read before posting.

Cube as player

I'm beginner. I want to create 3D game.
I used Character wizard and chose 3D cube gameobject as player. The 3D cube is added from unity gameobject menu.
I selected legay animation (because no animation)
And I changed the cube to prefab.
At this time, the cube prefab cannot be assigned as player in Setting menu.
I think the cube seems to have the following components. (but no animation)
what is inadequate in this case ?

Any Player prefab generally has the following components added:

>

A collider (generally a Capsule Collider for 3D players, and a Circle Collider 2D for 2D players
A Rigidbody for 3D players, or a Rigidbody 2D for 2D players
The Player script component
The Paths script component
An Animation or Animator component, depending on your chosen animation engine
Audio Source (optional)

Comments

  • I created a new player character using Character Wizard and I was able to add my Player prefab (cube) as the player in Settings->Character Settings->Player. I took the Player Cube from my scene and added it into my prefab folder (created a new folder in Assets and labeled it prefab). From there I deleted the Player Cube from the scene and added the Player Cube prefab into the Player slot under Character Settings. If you try to take your Player from the scene and add to the Player slot in Character Settings, it won't work. How did you change your cube into a prefab?

  • Thank you! it works well. i tried to add cube from scene, but as you say, i can add cube as player from asset.

  • edited June 2019

    Yes, the player prefab field requires an asset to be dragged onto it from the Project window.

    It's also recommended to use "Mecanim" even if you have no animations. Simply leave the Animator parameter fields (e.g. "Move speed float") empty, and you won't have problems - but can add them in more easily once you have animations.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.