Hello, I try to do a 3rd person camera using a camera object (I've already done it without it but I'm not satified by his behavior). But the problem is that when I use the action "Define properties of camera object" to modify the rotation, the values of this rotation gone completely mad! The problem is that I'm french and so my editor language is also french so I translate all the names for you, I hope I didn't do any mistake and that you will understand the parameters I modified.
I really don't understant how does the "Rotation" property of a camera object works with the code! (If "Rotation" is not the good word in english, the paramater I'm talking about is the one just before the last one when you use the action "Define properties of camera object")
Oh yes sorry, I forgot to say that I also locked the parameters to rotate the camera using the mouse in a init file that run at the start of the map. The idea is to take the rotation of the camera of player 1 and assign it to my custom camera and then assign my custom camera to be the camera of player 1, like that I have a better control of the player 1 camera.
I've done that like this because it seems to be the only way to track the mouse moves and transfert them to a camera object.
I know that this works because the camera moves but his first this move is really rought and then the angle yuo watch can go further than 90° or less than 0°, I don't know why.
The problem is that if I say for example that camera object rotation property = 270° and then I use a function to print the yaw of this camera it told me that the Yaw = 0!
I will say it one last time: your concept is wrong. It is not going to work. Try to think of another way to do it, or you will find yourself struggling to achieve something that is impossible because it is fundamentally wrong.
Thanks, but I can't find Apply Camera Object Property (rotation) for an object, it only want to make me apply the rotation directly on a player camera. (And as my editor is in french the names aren't the sames -_-)
I've been using these triggers a lot to gain more control over the camera as well. Your going to run into a lot of the same problems I did.
1. Camera rotation (unlike unit rotation) is calculated from -180 to 180, so any numbers you were using from 180-360 gave you problems.
2. Setting the Set Camera Rotation to a value (lets say 50) and then using the Get Camera Yaw function will give you a slightly inaccurate value (like 49.5214). This doesn't seem to be the case with Pitch but I haven't tested it enough to be sure. I don't have a workaround for this yet (IS KILLING ME).
3. Using the Get Camera Yaw/Pitch function only gets the camera yaw from before the current game loop. Meaning if you use Set Camera Rotation any time during the game loop, the Get Camera Yaw function will not reflect this update until next loop.
4. You can not set the values for Computer/Neutral/Hostile player cameras. Even though they do have default camera values if you check them.
5. Setting Mouse Look Sensitivity to anything lower than 0.002 (or 0.0002, i cant remember) makes the camera unmovable with the mouse.
For the moment the great problem in front of me is the one you exposed as problem "2". And it seems that the more you rotate, the more this "error" increase and that make the camera shake more and more violently... that's really annoying because I think it's caused by a bug and that's the only problem left in front of me :(
I didn't really look at all your code, but I do know that there's a bug with Galaxy right now I stumbled upon.
Instead of Set Camera Object Property (Rotation), try Apply Camera Object Property (rotation).
Setting the camera object rotation seems to have a bug in what degree rotation values it accepts.
Apply Camera Object Property (rotation) seems to have the same problem or maybe I don't use the good function. Are your sure that it may work with this function?
EDIT:
This is my current code, it's really close to work except an horrible shake of the camera who continuously switch between 2 positions when rotating (I precise that this 2 positions moves, that's why I think that this problem comes from the error told by Bauf)
Timer - Start (New timer) as a One Shot timer that will expire in 0.1 Game Time seconds
General - Wait for (Last started timer) to have 0.0 seconds Remaining
Point - Move Point 001 To ((Position of Merc - War Pig (Merc Marine) [97.62, 100.17]) offset by (0.0, 0.0))
Point - Make Point 001 face (Facing of Merc - War Pig (Merc Marine) [97.62, 100.17]) degrees
Camera - Set Camera 001 target to Point 001
Camera - Apply camera object Rotation (Facing of Point 001) for player 1 over 1.0 seconds with Existing Velocity% initial velocity and 10% deceleration
Timer - Restart (Last started timer)
There a nice smooth camera rotation for ya@Doom2Darkness: Go
I'm pretty sure the camera rotation in the GUI is bugged and does not work the way it is intended. Get camera Rotation still work correctly but Set and Apply does not.
(tried with -180 to 180 or 0 -360 or rad still doesnt work, and the camera setting used in the editor use 0 - 360 and any other value like pitch or roll is still working as intended)
How would you make a camera face a unit, that part was easy- now i have a 2 player map, how do i make the camera face 2 different units at once.... plz help ps i am a noob so if there is a simpler way could u say
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello, I try to do a 3rd person camera using a camera object (I've already done it without it but I'm not satified by his behavior). But the problem is that when I use the action "Define properties of camera object" to modify the rotation, the values of this rotation gone completely mad! The problem is that I'm french and so my editor language is also french so I translate all the names for you, I hope I didn't do any mistake and that you will understand the parameters I modified.
So this is the code translate in english:
I really don't understant how does the "Rotation" property of a camera object works with the code! (If "Rotation" is not the good word in english, the paramater I'm talking about is the one just before the last one when you use the action "Define properties of camera object")
Variable - Fix PlayerUnitRotation = (Yaw of player camera Player_1)
Camera - Define Player_1_Camera Rotation as PlayerUnitRotation
What are you trying to do with these two lines???
Oh yes sorry, I forgot to say that I also locked the parameters to rotate the camera using the mouse in a init file that run at the start of the map. The idea is to take the rotation of the camera of player 1 and assign it to my custom camera and then assign my custom camera to be the camera of player 1, like that I have a better control of the player 1 camera.
I've done that like this because it seems to be the only way to track the mouse moves and transfert them to a camera object.
Your above triggers are basically doing set b = a set c = b set a = c
which means they are doing nothing.
You need to think of another way to do the triggers.
No because there is a time between frame where the Yaw the the player camera is modified:
This is how it works:
I know that this works because the camera moves but his first this move is really rought and then the angle yuo watch can go further than 90° or less than 0°, I don't know why.
The problem is that if I say for example that camera object rotation property = 270° and then I use a function to print the yaw of this camera it told me that the Yaw = 0!
I will say it one last time: your concept is wrong. It is not going to work. Try to think of another way to do it, or you will find yourself struggling to achieve something that is impossible because it is fundamentally wrong.
I didn't really look at all your code, but I do know that there's a bug with Galaxy right now I stumbled upon.
Instead of Set Camera Object Property (Rotation), try Apply Camera Object Property (rotation).
Setting the camera object rotation seems to have a bug in what degree rotation values it accepts.
Thanks, but I can't find Apply Camera Object Property (rotation) for an object, it only want to make me apply the rotation directly on a player camera. (And as my editor is in french the names aren't the sames -_-)
I've been using these triggers a lot to gain more control over the camera as well. Your going to run into a lot of the same problems I did.
1. Camera rotation (unlike unit rotation) is calculated from -180 to 180, so any numbers you were using from 180-360 gave you problems.
2. Setting the Set Camera Rotation to a value (lets say 50) and then using the Get Camera Yaw function will give you a slightly inaccurate value (like 49.5214). This doesn't seem to be the case with Pitch but I haven't tested it enough to be sure. I don't have a workaround for this yet (IS KILLING ME).
3. Using the Get Camera Yaw/Pitch function only gets the camera yaw from before the current game loop. Meaning if you use Set Camera Rotation any time during the game loop, the Get Camera Yaw function will not reflect this update until next loop.
4. You can not set the values for Computer/Neutral/Hostile player cameras. Even though they do have default camera values if you check them.
5. Setting Mouse Look Sensitivity to anything lower than 0.002 (or 0.0002, i cant remember) makes the camera unmovable with the mouse.
For the moment the great problem in front of me is the one you exposed as problem "2". And it seems that the more you rotate, the more this "error" increase and that make the camera shake more and more violently... that's really annoying because I think it's caused by a bug and that's the only problem left in front of me :(
Apply Camera Object Property (rotation) seems to have the same problem or maybe I don't use the good function. Are your sure that it may work with this function?
EDIT: This is my current code, it's really close to work except an horrible shake of the camera who continuously switch between 2 positions when rotating (I precise that this 2 positions moves, that's why I think that this problem comes from the error told by Bauf)
General - Repeat (Actions) forever
Actions
Timer - Start (New timer) as a One Shot timer that will expire in 0.1 Game Time seconds
General - Wait for (Last started timer) to have 0.0 seconds Remaining
Point - Move Point 001 To ((Position of Merc - War Pig (Merc Marine) [97.62, 100.17]) offset by (0.0, 0.0))
Point - Make Point 001 face (Facing of Merc - War Pig (Merc Marine) [97.62, 100.17]) degrees
Camera - Set Camera 001 target to Point 001
Camera - Apply camera object Rotation (Facing of Point 001) for player 1 over 1.0 seconds with Existing Velocity% initial velocity and 10% deceleration
Timer - Restart (Last started timer)
There a nice smooth camera rotation for ya@Doom2Darkness: Go
Wow that fixes the portrait lock problem too. You rock.
I'm pretty sure the camera rotation in the GUI is bugged and does not work the way it is intended. Get camera Rotation still work correctly but Set and Apply does not.
(tried with -180 to 180 or 0 -360 or rad still doesnt work, and the camera setting used in the editor use 0 - 360 and any other value like pitch or roll is still working as intended)
How would you make a camera face a unit, that part was easy- now i have a 2 player map, how do i make the camera face 2 different units at once.... plz help ps i am a noob so if there is a simpler way could u say