Garry's Mod Wiki

GM:GetPreferredCarryAngles

Description

Called to determine preferred carry angles for the entity. It works for both, +use pickup and gravity gun pickup.

Due to nature of the gravity gun coding in multiplayer, this hook MAY seem to not work ( but rest assured it does ), due to clientside prediction not knowing the carry angles. The +use pickup doesn't present this issue as it doesn't predict the player carrying the object clientside ( as you may notice by the prop lagging behind in multiplayer )
This hook can not override preferred carry angles of props such as the sawblade and the harpoon.

Arguments

1 Entity ent
The entity to generate carry angles for

Returns

1 Angle
The preferred carry angles for the entity.

Example

Makes all pickupable entities default to Angle( 0, 0, 0 ) relatively to players aim direction.

hook.Add( "GetPreferredCarryAngles", "MyPreferredCarryAngles", function( ent ) return Angle( 0, 0, 0 ) end )

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 3
Generate Html 5
SaveChanges (1) 12
Render Body 0
Render Sidebar 9