Skip to content

Commit

Permalink
[Pablo] Use Y to drop weapons
Browse files Browse the repository at this point in the history
je suis trop content!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • Loading branch information
Benualdo committed Sep 29, 2024
1 parent a9c7410 commit 2f6b7ae
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ void PlayerBehaviour::FixedUpdate(const Context & _context)
}
}

if (input.GetJoyLeftTrigger(joyID) > joyDeadZone)
if (input.IsJoyButtonJustPressed(joyID, JoyButton::Y))
{
if (nullptr != m_rightHandItem)
{
// drop
m_rightHandItem->SetOwner(nullptr);

m_rightHandItem->GetGameObject()->SetGlobalMatrix(this->GetGameObject()->GetGlobalMatrix());
if (auto * physicsBodyComponent = m_rightHandItem->GetGameObject()->GetComponentT<vg::engine::IPhysicsBodyComponent>())
physicsBodyComponent->SetMatrix(m_rightHandItem->GetGameObject()->GetGlobalMatrix());

if (auto * physicsShapeComponent = m_rightHandItem->GetGameObject()->GetComponentT<vg::engine::IPhysicsShapeComponent>())
physicsShapeComponent->SetComponentFlags(vg::core::ComponentFlags::Enabled, true);
Expand Down

0 comments on commit 2f6b7ae

Please sign in to comment.