• Unity3D - Discussion
    5,004 replies, posted
[QUOTE=Clivens;47472749]I've been trying to create my own character controller and I just found that Unity already has one sigh :/ Been trying to play with platformers/racing games because they are easy to make afaik[/QUOTE] i made my own as well, the default unity character controller is pretty basic though
Is there a way I can *refresh* an Animator? I'm trying to destroy/instantiate a player model, to change models on the fly, and it works, except for the Animator, which seems to lose its link and need to be refreshed, because if I tinker with a few settings in the editor on the Animator component, it'll refresh and work again. Is there a way I can hookup the new model to the animator on the fly? [IMG]http://i.imgur.com/G9ADAy6.png[/IMG] Animator highlighted in red is the main player object that contains the animator, and inside of that is the child *model* object. Anyone ever done player model changing similar to HL2 DM, or Garry's Mod like this?
I'm having some trouble getting particles to render over sprites. I only have the issue when I set the particle's material shader to something in the particle category, like Particles/Alpha Blended, so the particle system's start color actually takes effect. If I set the shader to Unlit/Transparent Cutout, it doesn't occur, but then the particle system's start color doesn't work. I've tried to play around with the sorting layers but no luck, any advice?
[QUOTE=sarge997;47477976]Is there a way I can *refresh* an Animator? I'm trying to destroy/instantiate a player model, to change models on the fly, and it works, except for the Animator, which seems to lose its link and need to be refreshed, because if I tinker with a few settings in the editor on the Animator component, it'll refresh and work again. Is there a way I can hookup the new model to the animator on the fly? [IMG]http://i.imgur.com/G9ADAy6.png[/IMG] Animator highlighted in red is the main player object that contains the animator, and inside of that is the child *model* object. Anyone ever done player model changing similar to HL2 DM, or Garry's Mod like this?[/QUOTE] [url=http://docs.unity3d.com/ScriptReference/Animator.Rebind.html]Animator.Rebind[/url] sounds like it does what you want.
How do you handle things like linear drag and air resistance? There's 'drag' in unity, but what if I want the player to have 0 drag in the air but not act like everything is fucking ice?
[QUOTE=war_man333;47481805]How do you handle things like linear drag and air resistance? There's 'drag' in unity, but what if I want the player to have 0 drag in the air but not act like everything is fucking ice?[/QUOTE] You can modify rigidbodys drag inside functions like OnCollisionEnter/Stay/Exit. You also have physics materials which have properties like friction.
[QUOTE=war_man333;47481805]How do you handle things like linear drag and air resistance? There's 'drag' in unity, but what if I want the player to have 0 drag in the air but not act like everything is fucking ice?[/QUOTE] I'd avoid rigidbodies altogether. At the point that you start needing to do things like modify drag in different situations to get a higher degree of control, rigidbodies become progressively less useful over, say, custom written character controller code.
[QUOTE=KillaMaaki;47484239]I'd avoid rigidbodies altogether. At the point that you start needing to do things like modify drag in different situations to get a higher degree of control, rigidbodies become progressively less useful over, say, custom written character controller code.[/QUOTE] I'd agree on this one, but use kinetic rigidbodies. Or what you had in mind, KillerMaki?
[QUOTE=Fourier;47484732]I'd agree on this one, but use kinetic rigidbodies. Or what you had in mind, KillerMaki?[/QUOTE] Depends. For 3D characters which require a high degree of precision and control, the CharacterController is actually just about ideal for writing your own movement code and letting it handle the collision detection. Particularly if you are working with something like Bolt, since having control over when the character updates is pretty much required for server authoritative movement. For 2D characters, particularly if you are working in a tile-based game environment, I'd consider writing my own collision detection code altogether. In my 2D platformer prototype for instance, I use raycasts to implement collision and avoid Unity's 2D rigidbody entirely. This imposes some limitations - mainly, that I cannot have tiles smaller than half the character width or half the character height (as they might be missed by raycasts), but this isn't a big issue for me.
I set the friction and drag on the floor and the characters, it still feels very wrong. I think I'll look into the character controller-thing.
Sorry, you need to Log In to post a reply to this thread.