I want to get the rotation, and then aply it to the pig, so it moves were the player is looking.
Also, a MoveToPosition to the block the player is looking should work.
I've tried some codes and with this I change pig rotation, but it doesn't walk.
Also, a MoveToPosition to the block the player is looking should work.
I've tried some codes and with this I change pig rotation, but it doesn't walk.
Code:
void cPig::Tick(float a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
if (m_bIsSaddled && m_Attachee != NULL)
{
if (m_Attachee->IsPlayer() && m_Attachee->GetEquippedWeapon().m_ItemType == E_ITEM_CARROT_ON_STICK)
{
MoveToPosition((m_Attachee->GetPosition()) + (m_Attachee->GetLookVector()));
}
}
}