Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Asked so many times so i decided to make it. Its nothing more but 2 cameras that you switch between -also camera targets will be synced so it looks like one camera in action.Also you cant stand up if there is no room. To use it just create 2 cameras and add all behaviours to them that you need ( sometimes you cant use some weapons while crouch so dont add those weapons to crouch camera and so on..-disable jump on crouch cam and set movespeed different) Video actually shows nothing informative so study from ccb file that i included. Download link in video description: https://www.youtube.com/watch?v=... |
||||
|
in simple a see sorc action but when i want add sorc he not added! cant add action why? |
||||
|
its as usual action it can be added as action. Maybe you tried to add it as behavior. action can be added : if key C pressed then action SorC. |
||||
|
This is how I made a crouch cam when I attempted to do it a month or so ago. I linked two cameras as well. The issue I ran into was the camera would get stuck moving forward without a key being pressed. Sven's example has the same issue. I believe I tried "resetting the behaviors of the node" to some success, but I never got it perfect. Any thoughts on stopping that bug, Sven? I believe one would have to script their own FPS camera to do so, but I might be mistaken. |
||||
|
Guest Issue happens because active camera cant unregister key event because of camera switch. even if you restart behaviour and key is down then active camera cant register key down event..so issue again. You can disable C key if movement key is active.. That means player can crouch if player have stopped moving. or code movement script for camera .. and set FPS camera movementspeed to 0 and use your own code instead. |
||||
|
@Sven Yeah that's what I figured. It needs some workarounds. On a side note: I had a similar issue of the camera moving forward on its own if I switched the scene with an "on proximity" behavior. If I transitioned back to the other scene, then the camera would bolt forward on its own and not stop. I thought it might have had something to do with the collision, but then I read about the input cache in the forums. Anyway, I can still use your example crouch behavior for seeing how you stopped the camera from switching when under stuff. I don't think I got that far previously. Thanks, Sven. |
||||
|
Very useful action sven, thanks for share with us! |
||||
|
Updated: https://www.youtube.com/watch?v=... Watch video to understand how it works. Download link in video description. Now there is custom camera movement script so there is no issue with camera moving byitself if camera switch done while keydown. Now you can setup 3 speeds: walk / run and crouch movement speed. If there is problems with it then let me know and ill fix it. |
||||
|
SVEN do redowload |
||||
|
guest_writer wrote: SVEN do redowload Its on my itch page:(also many other stuff that may be useful) https://itch.io/ |
||||
|
You are a very advanced programmer. |
||||
|
sven can you help with recognizing the camera rotation I would like for example to make the camera rotate after death to make it fully rotate this matrix, but even it seems it should be clear that the reverb engineered the work. I would like to simply execute the js code after death and the camera rotated Define a helper class for matrix transformations function Matrixhelper(bMakeIdentity) { // If bMakeIdentity is not provided or is true, initialize as an identity matrix this.m = bMakeIdentity ? [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } Matrixhelper.prototype.rotateVect = function (v) { // Rotate a vector using the matrix transformation var tmp = new vector3d(v.x, v.y, v.z); // Clone the input vector v.x = tmp.x * this.m[0] + tmp.y * this.m[4] + tmp.z * this.m[8]; // Apply the rotation transformation v.y = tmp.x * this.m[1] + tmp.y * this.m[5] + tmp.z * this.m[9]; v.z = tmp.x * this.m[2] + tmp.y * this.m[6] + tmp.z * this.m[10]; }; |
||||
|
I dont understand where you want to rotate your camera? Camera can be moved by setting its position and rotated by changeing its target.. Probably doable even without script but with built in actions. |
||||
|
Sven sorry translator translation is crooked |
|