Jump to content

C++ SetInput incorrect work


2ima
 Share

Recommended Posts

using reference i found how to make entity movement and got such:

move = window->KeyDown(Key::W) - window->KeyDown(Key::S);
strafe = window->KeyDown(Key:) - window->KeyDown(Key::A);
//Making sure that movements is normalized so that moving forward at the same time as strafing doesn't move your character faster
normalizedmovement.z = move;
normalizedmovement.x = strafe;
normalizedmovement = normalizedmovement.Normalize() * movespeed;

//Adjust and set the camera rotation
playerrotation.x += mousespeed.y*sensitivity / 10.0;
playerrotation.y += mousespeed.x*sensitivity / 10.0;
entity->SetInput(playerrotation.y, normalizedmovement.z, normalizedmovement.x, jump, crouched, maxaccel);

 

and entity is not moving! maybe somebody more experted than me can see my mistake?

Checked out FPSplayer.lua, looks like just myne. Kinda magic) Maybe smb has more sufficient metod of entity movement? Thanks beforehand!)

Link to comment
Share on other sites

Hard to say with the code provided. Does the 'entity' have a mass greater than 0? Does the 'entity' have its Physics Mode set to Character Physics? Have you tried printing out the values of 'normalizedmovement' X & Z values? What's the 'maxaccel' variable set to?

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

entity mass is 50, Physics Mode and Character Physics is set properly, 'normalizedmovement' X & Z values is set and working... maxaccel is maximal acceleration to disable enitity's element race.

The thing is in what when I try to use constant values instead all of those still nothing

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...