How to Create a 3D Shaky Camera Effect in GML - gml

I am currently working on a project in GameMaker:S.
I want to know how I would create an effect where the 3D camera bobs around, as if it is being held by somebody with unsteady hands? I've been trying to figure something out for a couple of days now.
Cheers.

1.Maybe you can create an invisible object, edit it so it can randomly teleport or move to locations and then make the view[0] to follow it.
or you can create a path for the object to follow.
2.You can create a variable like; x = irandom(-100,100) and set the view to follow it.
3.Use the most foolish method: instead of camera, let everything else move so that the player things camera is moving. You can do this by randomly moving background, objects etc.

Related

How can I modify the Lyra camera to make a Top Down game in UE5?

I'm trying to make a Battlerite like game. Lyra comes with CM_ArenaFramingCamera which produces a fixed camera that doesn't track the player. I don't really understand how this is achieved, and I'm not sure how I could modify it to follow the player. Where would something like that happen and how would it play into the Ability system?
I've also tried looking at the CM_ThirdPerson camera to modify it to function as a top down camera. I understand how to change the curves to position the camera, but there's a lot of weird behavior associated with this and I'm unclear of how to fix the rotation.
I'd appreciate anybody that has a deep dive on using the Lyra system to modify and create custom cameras!
To get the same effect as the SpringArmComponent what I basically dis was to create a new class inheriting from ULyraCameraMode and copy paste all the methods from SpringArmComponent. The tick component I replaced it with the method ULyraCameraMode::UpdateView. The most important modification you have to do is inside the method UpdateDesiredArmLocation(), here at very end of all the calculations just set.
View.Location = ResultLoc;
View.Rotation = DesiredRot;

No keyframes are visible but the object still moves

I'm using Blender 2.8 and I just have 2 objects: hand and gun and I want to create animations for them. So, for instance, I want to create a simple firing animation. What I do:
1. I create animation for gun
2. I create animation for hand
But if I switch somehow incorrectly I "lose" the first animation I've created. I tried creating fake users and stuff. I just don't get why I select the armature for which I've just created the animation, it plays, but there are no keyframes.
Here's the vid, here's the file.
Ask me questions if you have any.
The movement may be cached in Blender, you may need to reset the movement cache.
Alternatively, you should look at both the Track Controller and Dopesheet(action editor) - the animation may be stored in both.
The movement could be related to parenting ( to an object that is moving )
The movement could also be caused by physics simulation of a rigid body.
Hopefully with the help of the above, you find the problem.
I had the same problem. In the Animation mode (horizontal tabs across the top of the window), click on the object to animate.
The keyframes will appear.
If the object is not selected, the keyframes disappear.
Just leaving this here so that nobody spends 30 minutes trying to work this out, like i just did.

How to make the Camera have collision detection Physi.js First Person Shooter

Project Premise
The idea for my THREE.js game is the have the player navigate though a maze of objects and reach an exit. I need collision detection not just for cubes and spheres, but also models imported from Blender. I thought about using RayCasting but I decided to go with Physi.js.
The Problem
,The idea is to give the camera a "body" so that the player can't pass though wall or other objects like they can when they are just a camera object. However, My "player" object seems to loses all of its Physi.js attributes as soon as I give it THREE.PointerLockControls(player). What I'm doing is creating a Physijs.BoxMesh, the player, and adding the camera to that. After that I pass the "player" object to my setupControls() function.
var geometry = new THREE.BoxGeometry( 500, 500, 500 );
var material = new THREE.MeshPhongMaterial( {color: 0x0000FF} );
player = new Physijs.BoxMesh(geometry, material, 1, {restitution: .9, friction: .1});
scene.add(camera);
scene.add(player);
player.add(camera);
//give player control of THIS mesh.
setupControls(player);
The Controls work as expected, I can control the player mesh with the camera stuck to it creating an FPS view, but I when I do this I can still move though walls and other objects. I've even moved the camera back on the Z position to confirm whats going on and I can see that the player mesh is just passing though objects instead of being hindered or knocking them over.
Solutions?
If I remove setupControls(player), then the Physi.js physics begin to work on the player mesh! It will fall from gravity, bounces around and everything. It looks really cool, but now I can't control it! It seems like I can only have one or the other lol. So does anyone know what I could do to solve this problem? Is what I'm preposing even possible? I'm new to THREE.js so any input is much appreciated!

TILED editor - object placement possible to snap to grid in Object Layer?

thanks again in advance for any time spent helping me.
Thankfully, I have been able to import TMX to libgdx game without much of a problem, however this is now the first time of using Object Layer, for which at this moment in time I only want to include Platforms as the object (ie. I have 1x Tile Layer showing my background image and 1x Object Layer above). Now I've seen that I can just draw lines and/or boxes, circles etc to create 'zones' which I can pull into my code (goodness only knows how atm but I'll figure that later/soon )
But I see in Tiled that the button - Insert Tile (T) - exists.
I'm trying to use it but when the tile im using as a platform is placed it goes exactly where the mouse is pressed and I can't move it other than delete it. I'd just like to copy-paste a whole row of them for now and Level1 can just be 50 tiles in a flat line just so I can get it all working. It seems weird to me that Tiled can't do this but Ive spent ages looking for a way and can't find it.
Am I missing something or is this just not possible? And if the latter, how does an experienced tiled user (who's making a 2d platformer) go about creating such a simple example above in the Tiled environment?
What a noob - I answered my own question. The option I needed was in the 'View' dropdown menu -> 'Snap To grid' LOL

Three.js 3rd person camera

I'm trying to create a 3rd person camera view in three.js
I'm using the THREE.FirstPersonControls(); on my camera. Then setting the rotation and positions of my "player" objects to be the same as the camera with some offsets.
This does not seem to work.
What i'm more wondering is if I should be adding my FirstPersonControls to the camera and then rendering the "player" infront of it. Or adding the controls to the player then making the camera always point at the back of the player?
EDIT:
I've tried setting the player object to be a sub object of the camera using camera.add(player);
but moving the camera around is not moving the player. I thought adding an child element would mean they move together?
EDIT 2:
I took another approach of adding both the camera and the player to a group then adding my 1st person controls to that group... Now both the camera and the player do get rendered. But it's completely thrown off how the first person controls worked. (e.g. looking down goes left etc etc)
Thanks for any help,
James
First of all, the Controls were designed to be controlling a camera, and not an object. And since by default, objects look "up" the z-axis, and cameras look "down" the z-axis, it is unlikely that the Controls will work as expected when applied to something other than a camera.
Secondly, the Controls are part of the examples, and not the library, so they are not officially supported. You are free to hack away at them.
One way to achieve what you want is to make the camera a child of your player. Something like this:
player.add( camera );
camera.position.set( 0, 50, 100 );
You may, in your render loop, need to set:
camera.lookAt( player.position );
Then you want to control the player with the mouse or keyboard. Your best bet is to write your own controller to do that. There are plenty of examples on the net.