Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Explanation of how to implement scopes/iron sight graphics

A topic by Scruffy86 created 97 days ago Views: 59 Replies: 1
Viewing posts 1 to 2

I see there is a new weapon zoom feature in the new version. I might have missed something, but I don't see anything in the manual about how to implement it. At your convenience, could you provide a brief explanation of how to allow a zoom of a particular weapon when right mouse button is clicked? 


And, does this mean there is now a way to replace the HUD weapon sprite with an iron sight sprite or a crosshair sprite when the right mouse button is clicked? I'm very familiar with FSM and all the weapons in my game use FSM for custom detailed reload animations, so I'm sure with a little guidance, I can figure it out. 

Thanks!

Developer

In your weapon FSM, add an ALTATTACK state, and you can set one of the frame actions to ZOOM
Something like:

state ALTATTACK IDLE 0
frame 1 0.01 0 0 0 NONE
frame 1 0.01 0 0 0 ZOOM 40
frame 1 0.01 0 0 0 READY

And to have it reset when you're not holding right-click, do something like this in your idle state:

state IDLE NONE 0
frame 1 0.01 0 0 0 NONE
frame 1 0.01 0 0 0 ZOOM 0
frame 1 0.01 0 0 0 READY