How to do "Abuse" aiming?

Hi, Im working on a 2.5D sidescroller but I’ve bumped in to some problems regarding aiming…

How can I make the gun aim at the set position?
I’m trying to do it as its done in the old 2D actionfest Abuse :slight_smile:
I have tried with transform.LookAt() and my script works for objects thats not a child of anything, they point in the right direction, but I need (I think) to have my gun as a child to the soldier…
If its a child it just plays the normal animation!

Is there any way to do this? perhaps with IK?
I’m still a Unity newbie in learning so if my questions are stupid, bear with me :wink:

not sure exactly what you’re referring to but if you want something to point where the mouse is yoggy posted a nice example here:

http://forum.unity3d.com/viewtopic.php?t=5719

; )

Your gun object is being moved by the animation every frame right after you call LookAt(). Try putting the LookAt() call in LateUpdate(). See this page on the wiki for a bit more info: unifycommunity.com

Thanks, works like a charm now :slight_smile:

Although now I have another dilemma related to the aiming…
I started a new topic about it, didn’t think of this one

http://forum.unity3d.com/viewtopic.php?t=6360