Product Chat / [SOLVED] Third Person Camera

Author
Message
Nevin
9
Years of Service
User Offline
Joined: 19th May 2015
Location: U.S.A
Posted: 3rd Aug 2020 22:22
Hello,

I wanted to know if it is possible to lock the third person camera from rotating when moving the mouse, to keep it looking at the character at the same angel and not rotate, but still follow the player around.

I did not see anything in global script to help with this. I am still checking gameplayercontrol for a solution

The author of this post has marked a post as an answer.

Go to answer
Nevin
9
Years of Service
User Offline
Joined: 19th May 2015
Location: U.S.A
Posted: 3rd Aug 2020 22:28
I have found something here in gameplayercontrol, I think I have it

-- Rotate player camera

if ( g_PlayerHealth>0 and g_suspendplayercontrols == 0 ) then
-- when camea rotation overridden, prevent rotation
if ( GetCameraOverride() ~= 2 and GetCameraOverride() ~= 3 ) then
-- SetCameraAngle ( 0, GetGamePlayerStateCamAngleX(), GetGamePlayerStateCamAngleY(), 0 )
-- SetGamePlayerControlCx(GetCameraAngleX(0))
-- SetGamePlayerControlCy(GetCameraAngleY(0))
-- SetGamePlayerControlCz(GetCameraAngleZ(0))
end
-- when camera overridden, do not allow movement
--
if ( GetCameraOverride() ~= 1 and GetCameraOverride() ~= 3 ) then
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 4th Aug 2020 00:52
OR ... Use lockmouse.lua ?
Seems a lot of work you have going there that may not be needed.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Defy
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 4th Aug 2020 12:43
Hi there, link below may be something of interest. All the best
https://forum.game-guru.com/thread/221648
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 4th Aug 2020 13:05
@Defy
Brilliant Link. Thanks
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Nevin
9
Years of Service
User Offline
Joined: 19th May 2015
Location: U.S.A
Posted: 6th Aug 2020 14:04
I dont see lockmouse.lua in the script folder.
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 6th Aug 2020 16:06
Quote: "I dont see lockmouse.lua in the script folder."

Really.. I thought it was stock .. Wonder where i picked that up then ?
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 6th Aug 2020 18:11
This post has been marked by the post author as the answer.
ActivateMouse() should do it.
DeactivateMouse() should turn it off.

Basically, this is used (as it sounds) for selecting your choices on screen
with a mouse cursor... or movement with camera locked...
PM
Nevin
9
Years of Service
User Offline
Joined: 19th May 2015
Location: U.S.A
Posted: 17th Aug 2020 16:37 Edited at: 17th Aug 2020 16:47
@GubbyBlips Thank you. I moved on to working on other things and just came back to this. I don't know why I did not think of that. I use ActivateMouse() in my project now already, I knew it locked cam but did not think of using it constantly, derp.

This bring more questions

Login to post a reply

Server time is: 2024-11-23 15:18:18
Your offset time is: 2024-11-23 15:18:18