• Parenting Question
    2 replies, posted
So what I'm trying to do is make an upside down bucket on the head of a player that, if another player presses the use key on, will be removed. When looking straight ( level aim position ) the position of the bucket is fine. When moving the mouse up and down the bucket seems to move, via rotation, off the head. I would normally resort to a client-side hat but would prefer the entity to be usable to remove the bucket. Is there anyway to stop the bucket from rotating based on the player's aim position to where it stays on the head? Here is the code to spawn the bucket: local bucket = ents.Create( "bucket" ) bucket:SetPos( Vector( 0, 0, 69 ) ) bucket:SetAngles( Angle( 0, 0, 180 ) ) bucket:SetMoveParent( ply ) bucket:Spawn() Here are the two related functions in the Entity File: function ENT:Initialize()         self:PhysicsInit( SOLID_VPHYSICS )     self:SetMoveType( MOVETYPE_VPHYSICS )     self:SetSolid( SOLID_VPHYSICS )     self:SetCollisionGroup( COLLISION_GROUP_WEAPON )          local phys = self:GetPhysicsObject()          self:SetModel( "models/props_junk/MetalBucket01a.mdl" )     if( phys:IsValid() ) then         phys:Wake()     end end function ENT:Use( activator, caller )     SafeRemoveEntity( self ) end
Try this: Entity:FollowBone
It works wonderfully. Thank you for the help.
Sorry, you need to Log In to post a reply to this thread.