Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / how to creata a Third person

Author
Message
threedslider
5
Years of Service
User Offline
Joined: 8th Jul 2018
Location:
Posted: 20th Jun 2019 19:17
Hi all,

Any have an example from coding sample to make third person game ?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 20th Jun 2019 20:48
Quote: "in the below snippet should provide you an example"


A small random 3D world of fractals and Kaleidoscopes

What started as a test is turning out to be a minigame
Using a character Controller and physics, spawns enemies that can be shot
and these are shown on a radar and uses particle effects on enemy shot

At the moment levels increase every 5 Kills
Which increases the movement speed of the enemy exponentially with log
and decreases the spawn time. There is a bonus level once you reach level 5



Controls
mouse sets direction and aims
up arrow move forward
down arrow move backward
left arrow strafe left
right arrow strafe right
mouse left button shoots
mouse right button jumps
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
threedslider
5
Years of Service
User Offline
Joined: 8th Jul 2018
Location:
Posted: 21st Jun 2019 17:14
Great ! Thank you !
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 23rd Jun 2019 19:37
Pretty Good stuff!
But isn't this actually a 1st person game, for we are not observing the player?
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 4th Jul 2019 19:34 Edited at: 4th Jul 2019 23:21
I place the camera behind the player object then render based on what the camera sees.



You can add MoveCameraLocalX to shift the camera left or right for more of an over-the-shoulder view.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 7th Jul 2019 20:53
Yep that's a way to do it(I do). That way you'll see the player character. For real 1st person games a lot of programmers just render the lower arms, hands and weapons, but I prefer to be able switching modes by player preference.
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 21st Jul 2019 08:51 Edited at: 21st Jul 2019 08:51
If you move your player forward, the camera follows you on a "stick", but if you move left or right, the camera stays in place and rotates on its Y-axis and the player moves and turns 90° from the view of the camera. The rotation of the camera would be a side-effect, if the camera would look at the "player" but do not move and stay in place.

and with that in mind, we also could create a more complex camera rig, where the camera could have a capsule and if you are in a small room, the camera-capsule could colide with the walls and would move to the player and we would see our player-character much more filled of the view, because we are not so far away anymore.

And if we are on a free ground, only the sky is the limit e.g., we could have also a walking camera-distance and a running-camera-distance. And our camera would only slide on this "stick"

Attachments

Login to view attachments
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 22nd Jul 2019 13:48 Edited at: 22nd Jul 2019 13:50


FixObjectToObject does not work how I thought it has to function, after using FixObjectPivot ... but from that on we could start with moving our Objects and use not World-Positions and World-Angles, and could improve also the collsion. At this moment, the objects have no physics or collision bodies.

Attachments

Login to view attachments
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 22nd Jul 2019 17:52 Edited at: 22nd Jul 2019 17:53
Quote: "If you move your player forward, the camera follows you on a "stick", but if you move left or right, the camera stays in place and rotates on its Y-axis and the player moves and turns 90° from the view of the camera. The rotation of the camera would be a side-effect, if the camera would look at the "player" but do not move and stay in place."

This is what I did after some pointers from Janbo, Sphinx and other people.
See: https://forum.thegamecreators.com/thread/221892

It's not done yet, but lacking time currently.
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 23rd Jul 2019 09:29



Now with movement, but not with rotation and also not moving from camera-view.

Attachments

Login to view attachments
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 23rd Jul 2019 12:21


Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-28 21:04:08
Your offset time is: 2024-03-28 21:04:08