Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / I wan't the player to be walking, not flying

Author
Message
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 9th Feb 2012 02:59
As you can see in my code snippet I have made a mouselook and the camera follows the object. If I rem out 'set object to camera orientation' the object will not change it's orientation.

So this command suits me, except that I do not want the player to fly even when 'look up'



Anyone knows how I can correct this problem?

Best regards

www.memblockgames.com
Millenium7
19
Years of Service
User Offline
Joined: 13th Dec 2004
Location:
Posted: 10th Feb 2012 05:54
this will set the object to look left/right with the camera



it will only set the Y orientation, not up/down, for full rotation locking use

mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 10th Feb 2012 12:22
Ok, thank you. I thought that rotate object just rotated the object, not it's axis. But since this work the command apparently does Thanks again.

www.memblockgames.com
Millenium7
19
Years of Service
User Offline
Joined: 13th Dec 2004
Location:
Posted: 10th Feb 2012 20:27 Edited at: 10th Feb 2012 20:30
Quote: "I thought that rotate object just rotated the object, not it's axis"


it does, but so does the camera. So when you are facing to the right the camera might be 90 degrees, and so using the above command will set the objects angle to 90 degrees. The value is absolute and not relative. The original axis remains the same, 0 would be facing forward/north again

In order to realign the axis you can use



this will reset the axis at it's current angle, so if you set it to 90 degrees, and then fix it, it's current heading will become '0'. This is not suitable for what you are doing however, since if you set it to 90 it won't be facing right like the camera, it'll be facing south (90 degrees from it's already 90 degree offset/fix, meaning 180 'globally')

fixing the axis is used for when your models aren't rotated properly. 3d modelling programs seem a bit funny when they are exporting, and your object might appear to be lying on it's side instead of upright. This is where you x/y/z rotate the object and then fix it

Login to post a reply

Server time is: 2024-05-09 07:34:46
Your offset time is: 2024-05-09 07:34:46