Setting player's camera
Hello, I am newbie, but I really cant get this problem solved.
I want the player's camera, that I can change any way I want (3rd person for example). I tryed to change every game frame like this: Code:
public OnGameFrame() Code:
public Action:CreateCamera(iClient, args) I aslo tryed this code: Code:
new hOwnerEntity = GetEntProp(client,Prop_Send,"m_hOwnerEntity"); Maybe its bad idea to use sourcemod for this? Maybe I should use vscript some way? I really dont have any ideas. Pls haelp :shock: |
Re: Setting player's camera
Maybe it help:
https://forums.alliedmods.net/showthread.php?t=297161 ++ (from @Silvers) Code:
// Hooked 3 times, because each alone is not enough, this creates the smoothest play with minimal movement stutter |
Re: Setting player's camera
Thank you for answer. The Lux's plugin was the first thing I explored. My 2nd code from previous post is code I writed after reading Lux's .sp. But the problem is, when I SetParent the camera to player, camera rotates around the foots, not around the center of the player.
I don't really know how to work with SDKHook_PostThinkPost, but I found one function in Lux's plugin: Code:
public Hook_OnPostThinkPost(iClient) My game is L4D2. |
Re: Setting player's camera
You have to move code of your "OnGameFrame" to a callback of these 3 SDKs. All SDKs shoud point to the same callback. You can see using example in this plugin.
Executing code on each game frame is a very CPU expensive operation. As about your second code, here is a description of all "point_viewcontrol_survivor" properties: https://developer.valvesoftware.com/...ntrol_survivor You can try something, like "SetLocalOrigin". Also, isn't Code:
TeleportEntity(iEntity, Float:{ -200.0, 0.0, 70.0}, Float:{ 0.0, 0.0, 0.0}, NULL_VECTOR); X = -200.0, Y = 0.0, Z = 70.0 ? Try change Y. Also, some discussion and almost finished L4D1 port of Lux's plugin can be found here. Maybe it can help you somehow. |
Re: Setting player's camera
I think you don't understand my problem properly - my camera rotates around pivot point. When I making SetParent to player its choosing the axises of pivot from player model. Pivot of player's model located at the foots. So any changes of origin and angles - won't help becase the problem is in the parent. Maybe I can some way attach to the standart camera entity (if it's exist) or any another entity that in the center of player?
My target - is to have custom thirdperson view like in Resident Evil from the shoulder. P.S. I also tryed those function instead of game frame: Code:
SDKHook(client, SDKHook_PostThinkPost, onThinkFunk); |
Re: Setting player's camera
To control third person camera there are ConVars (unfortunately, it's client side only):
Code:
c_thirdpersonshoulderoffset 20.0 |
All times are GMT -4. The time now is 20:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.