Forum rules - please read before posting.

Unresponsive Custom Player Right from the start

The player I make appears above the navmesh, in the middle of the screen without regard to Playerstart and moves way to the left or right, depending on which side from the center I click.

In order to reproduce: make your own player in 2D, add all the scripts to it and start the demo (Brian works well).

1.47a.

Comments

  • Hi,

    a) does your player have player script attached?
    b) are all the animations listed correctly in the player script?
    c) is the player script on a gameobject and the sprite a child object of that?
    c) is the sprite (should be child) of the player set in the (parent) player script - near the place where you enter the animations. There;s a slot for child sprite.
    c) is the playerStart over the mesh?
    d) is the navmesh been set as scene default under scene settings? (has a slot for it)
    e) is the playerStart set as scene default under scene settings? (has a slot for it)

    Ii have had this problem when I first started using AC, but cant 100% remember what it was,
    But sure it was something about the player that was not created correctly.

    Cheers
  • Have you read this tutorial on creating a 2D player character?  Just tag the resulting prefab as Player, and it should work.
  • I've read the tutorial and I only missed adding player to Ignore Raycast layer which didn't help. 
    As for the c) playerStart over the mesh - it doesn't have order in layer (maybe not a 2D thing).
    Mesh is new too and I've assigned it as default.

    The player I'm using has my own custom state machine with only 4 (Idle/walk/left/right) states and I'm using Unity Sprites Complex. 

    (Here I have to divert and say about another bug and it's reproducable with Brian: when I change from Sprites Complex - to - Sprites Unity the mecanim parameters don't change to Sprites Unity (Only - Complex -> Sprites Unity))

    (Bug 2 - cursor blinks)

    Basically I tried to do the 12:00 - 15:30 part of 2D tutorial. There char only had the basic components and could move around even without proper animator setup. Mine seems to be overshooting what click badly on X axis.

    You can try and see if it would work for you, this is my test player without state machine http://rghost.net/6gPPL2S9K
  • edited August 2015
    i downloaded and looked.

    Your player seems wrong to me.

    There should be a gameobject with player script on it.   Then a child with the sprite render on it, and the animator.

    The animations should have 

    Walk_L
    Walk_R
    Walk_U
    Walk_D

    If you want diagonals make them too.

    This is the way I do it anyway, May there is another way, but this works for me :)

    Updated the player - try this:
    https://www.dropbox.com/s/61gjdbi4qst511b/redo.unitypackage?dl=0

    Please note:
    I didn't have much time so not 100% sure why sprite is rotating when moving left and right (well forgot why). Maybe Chris can say why. 

    Also, used the 2d_Demo managers when creating this.
  • I'm getting a "network error" message when trying your link.  Please re-upload it to a secure host and I'll take a look at it - or better yet, post screenshots of your inspectors.

    Thanks for the report about the animation fields bug - very odd, but I'll fix it.
  • The one sent through dropbox by klarax is still broken so you can take it.

    Basically I click a bit to the left from center and it hurls way left and vise versa.

    What I did was messing with it in another project trying hard to make a custom movement and state script repeatedly rewriting it.

    I wonder whether many had this problem like us with klarax. I sure had it before more often then not.

    You might make a poll in the next update, asking whether people managed to follow through tutorial with own assets.
  • I was referring to your link, @zodiac13 - I still can't download it.
  • As @klarax has pointed out, there's no Player script to be found on the prefab.  Add one on the base object, and remove the Sprite Renderer from it.  The Sprite Renderer should be placed on a child object (and that object should be marked as the "Sprite child" within the Player Inspector.

    The Animator component can be placed on either the root object or the sprite child.  Also be sure to clear the sprite child's transform, so that it is at the same location as the parent object.

    Again, you can refer to the text tutorial - or the video tutorial - for guidance.
  • It's the copy of the player I did before importing it into AC project and adding all AC components and adjustments. Did it work for you?
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.