Jump to content

Recommended Posts

Posted

so i have this code in C++

Entity *spawn = world->FindEntity("Spawn");


Entity *player = Prefab::Load("Prefabs/Player/FPSPlayer.pfb");
player->SetPosition(spawn->GetPosition());
player->SetRotation(spawn->GetRotation(),true);

 

problem is, my player isn't being rotated. It's position is being set, but it isn't being rotated. Could someone give me some insights please?

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Posted

You need to set the input to control its angle since it is using character controller physics.

 

I just added a line of code that will automatically set the character controller rotation to the yaw in this command, so it acts more like you expect.

  • Upvote 2

Let's build cool stuff and have fun. :)

Posted

when will this new line of code take effect?

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Posted

Well, I added it in and then it caused a problem and I took it out.

 

You can use Math::ATan2 to figure out the correct angle from the difference between the two entity positions.

Let's build cool stuff and have fun. :)

Posted

i have the amount that my controller needs to turn. It just isn't making sense how to translate a rotation on 3 axis' to a single float value.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Posted

but what if i wanted to rotate my controller along the z or x axis? set input just takes a single float, how would i translate this?

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...