edited March 2014 in ORK Support
hi,

just a quick question. I was working on my battle system all day and I did something so my character (a standard cube) started moving down into the floor until it found some sort of base position down there. My enemy stayed in the right spot, and would attack the player down through the floor, and then come back to its base position.

I tried a million things today until I realized something was wrong with my prefab for my character. when i decided to use brown pants instead, it worked perfectly.

here are some videos of it:

this is with the cube not working:
http://youtu.be/AeLSwJmID40

this is brown pants working correctly:


here is the details on my cube:

image

i tried it with a character controller and without and the results were the same. I just noticed you had one on the brown pants so I did the same.

is there something I'm not getting about creating a character prefab here? what am I doing different?

On tuesday I will be getting my real model for the character and I plan on plugging it into the game.

thank you very much for your time.
Post edited by mattsnee on
  • edited March 2014
    As a rule of thumb, I always place the actual character model as a child of the game object. The problem (if I understand it correctly) may be because the model's centerpoint is spawning beneath the terrain. Does that help?
    Post edited by Nixter on
  • I messed with the collider and it seems to have fixed it. I made it bigger and raised the center point, and it's staying on the ground now. It's funny how many little details you have to worry about and the tiniest mistake will get lost underneath miles of options.

    thanks a lot for your advice. I'm going to place my model as a child now just in case any other problems pop up.

    Thanks again.
  • Yeah, that's usually because of the center position being in the center of a prefab and not at the feet.
    You can also add a spawn offset to your combatants to spawn them correctly :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I'm still having problems with this. I do notice differences if I place the battle spots on the ground. this first video shows if I DO place it on the ground, leading me to the problem:



    and this one shows if I don't.



    as you can see if he is not placed on the ground, he STILL dips down after his attack to a certain point. I have been messing with the offsets, but he still does this. I don't have any problems in the field.

    Any ideas?
  • Pause the game in the battle and check where your battle spots are located.
    E.g. if they aren't located at the ground, they've probably not found the ground due to your layer settings for the raycast.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • it's really weird. I looked at the player during the battle, and he moves 6 points down Y as he attacks, and then another six as he returns to base. So in a move it's 12 points down Y. Attack again, and he does the same thing, moving a total of 12 points down. He's not falling infinitely down through the floor, just moving that 12 points per attack. I don't get it.

    He's placed on the ground, there's no offsets, and I have no problem in the field. And plugging in offsets doesn't seem to make a difference. when i paused the game the battle spots were set to zero, and they were in the right place, and didn't move, so I'm not sure if it's that.

    I must have made a mistake somewhere, but I can't figure it out.
  • ok, now I've taken gravity off everything related to my player, and it seems to be working. I guess i don't really need gravity anyway. but for now -- it's working. Hopefully, it will stay that way.
  • What are the settings of your Change Position step?

    E.g. when your combatants have a Character Controller component, you should enable the Controller Move setting in the move step.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • my settings are the same as you have in the tutorial, but I just disabled the gravity, and it started working. I don't really need gravity in my game, I don't think, but then again I could be wrong. ;)

    I have controller move enabled. I've been through those events backwards and forwards thinking they are leading to the problem, but I'm not sure it is anymore.

    My friend suggested I use a mesh collider on my character rather than a box collider for the prefab. I haven't tried that yet, but I'm going to. But for now, disabling gravity on the change position steps and on the rigid body seem to have fixed it.

    I'll mark this as solved for now, but I might have problems again with it in the future. I hope not. :)
Sign In or Register to comment.