Jump to content

» «

Shoot and Aim during animations

5 replies to this topic
  • Twistedtwister

    Punk-ass Bitch

  • Members
  • Joined: 06 Oct 2011


Posted 29 August 2014 - 10:15 AM Edited by Twistedtwister, 29 August 2014 - 11:25 AM.

First off, big thumbs up for the community! 
Without your guys tutorials etc I would never pick up animating and scripting.
Altough everything is new for me, it is great fun :)
I have been the last couple of weeks playing around with animations and a bit of scripting
I figured out how te import and export and to bind the custom animation on a key.
The problem at the moment I keep stumbling upon is that Iam not able to play the animation and shoot/aim at the same time.
I replaced the Swimming/Idle for my custom animation (a dodge move)
I tried also the [email protected]/Fire , but same result and on top of that my animation aint working right anymore.
I hope sombody got a solution for me, seeing it can be done in several max payne scripts.
Script that I use for the Animation (It is from JulioNIB one of his tutorials)
Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
If e.Key = Keys.NumPad0 Then
Dim Animset As GTA.AnimationSet
Dim Animname As String = "idle"
Animset = New AnimationSet("swimming")
Player.Character.Animation.Play(Animset, Animname, 8)
End If
End Sub

  • Jitnaught

    Grass tastes bad

  • Members
  • Joined: 24 Aug 2013
  • United-States


Posted 29 August 2014 - 12:45 PM

It is possible to only play the animation in the upper body, and also walk while that animation is being played, but I do not believe it is possible to play an animation on your lower body only.

  • Twistedtwister

    Punk-ass Bitch

  • Members
  • Joined: 06 Oct 2011


Posted 29 August 2014 - 06:39 PM Edited by Twistedtwister, 29 August 2014 - 11:21 PM.

Thanks for your reply LetsPlayOrDy!

I gonna give it a trie this evening/night :)




So I thought well before I trie the upperbody animation trick.

Let`s get back to basics to see where it goes wrong.


I did the following.

Use the normal animations of Gta IV ([email protected] , Fire)

Bind them under numpad 0 and play them. 

What happened was that you get the aiming animation , but the mouse aiming isnt working , and there is no sound/gun flash effect.


After that I tried the same with melee functions melee_player_unarmed.wad.

This resulted in playing the right animation but there was no collision.



So now my question is, do I need to script the collision,Sound,Gunflash effects myself?

Or did I missed a crucial part?




  • leftas


  • Members
  • Joined: 13 Jun 2013
  • Lithuania


Posted 30 August 2014 - 10:20 AM Edited by leftas, 30 August 2014 - 11:00 AM.

InfamousSabre answer is better.

Best regards,

  • InfamousSabre


  • Members
  • Joined: 03 Jan 2013


Posted 30 August 2014 - 10:54 AM

You'll need to use animation flags to be able to control the horizontal aim during the animation. as for vertical aim, I'm not sure how this is done yet.  Normally, firing the weapon (sound, flash, bullet, ptfx, ammo reduction, etc) depends on the current animation time, and it's all handled internally of course. Melee is probably done the same way.


If you're using a drive-by animation, simply set the animation time to aim. there is no vertical aiming of the animation during drive-by's

  • leftas likes this

  • Twistedtwister

    Punk-ass Bitch

  • Members
  • Joined: 06 Oct 2011


Posted 30 August 2014 - 03:02 PM Edited by Twistedtwister, 30 August 2014 - 05:18 PM.

Big thanks for the Help guys!

Gonna give the Animation Flags this evening a trie.


Bit of a update/progress 

Yesterday I have been just playing around a bit to learn more about scripting.

Inserted my custom animation again, applied a force to it when near/targetting a ped.

So for now I have a impact effect for my melee animations.


The only thing was that I still had no collision. 

So after bit of reading went true the object browser/native`s and found this one: GTA.World.TriggerCollisionsAt(GTA.Vector3)

Iam just wondering how I can make it that the collision is active on ped and player (still need to read a lot of info)








ps: Cookie for Julio NIB , his tutorials are helping me a lot :)

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users