How do I rotate sprites? Created 5 months ago2024-05-29 20:47:03 UTC by saenghr saenghr

Created 5 months ago2024-05-29 20:47:03 UTC by saenghr saenghr

Posted 5 months ago2024-05-29 20:47:03 UTC Post #348835
Posted 5 months ago2024-05-31 16:02:30 UTC Post #348836
Most sprites in GoldSrc already automatically rotate on their own, to face the player camera. This is known as Parallel Orientation. It is one of 5 Orientation types:
  • Parallel - Most common default type; image always faces camera
  • Parallel Upright - Locked to z-axis so only rotates to face camera (best for things that need to be placed on ground, for example trees or fire effect)
  • Oriented - Does not rotate to camera; has a fixed orientation defined in hammer (not for use with env_glow)
  • Parallel Oriented - Faces camera just like Parallel but can be rotated in hammer (not for use with env_glow)
  • Facing Upright - Lesser used mode that works just like Parallel upright, but rotation aligns with player origin instead of camera. (can be buggy at close distances, would only recommend for a specific effect)
- From The303's GoldSrc Sprite Tutorial
What you might want to use is the Oriented type. In vanilla HL1 you're not able to set a sprite's Orientation type through mapping, it must be done by editing the sprite file itself. You can use Half-Life Texture Tools to do this, either when creating a new sprite or when editing an existing one.

After that the sprite will obey the Entity Attribute: Pitch Yaw Roll (angles) keyvalue.
Posted 5 months ago2024-06-01 05:45:29 UTC Post #348840
To add, there's a sneaky hanky panky going on with roll values that's relevant for oriented type. If Roll is 0 then Yaw and Roll will get swapped. Therefore Roll needs to be non-zero eg 360.

Everything is documented in the wiki page for env_sprite.
You must be logged in to post a response.