Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
Camera following 2 objects

Abunimer
Guest
Quote
2023-03-14 05:41:47

Hi , i need a new option for camera which is , camera follows 2 objects , just like the fighting games .


okeoke
Registered User
Quote
2023-03-14 09:50:05

Hi Abunimer,

You can code it yourself. Based on you description, I would try the following approach:
1. add a dummy object (sphere with 0 radius) and attach a follow camera to it;
2. add a behavior to it which:
- gets the positions of your objects;
- finds a middle point between them;
- puts a dummy object from p1 there
If you have 2d style camera, i.e. your object positions are fixed on one of the axis you can also move camera closer and further from the dummy object depending on the distance between the objects.

The actual implementation and approach depends a lot on what exactly you need to do, since camera can have:
- fixed position, or can move;
- camera position can change on 1/2 or all 3 axis
- camera can rotate or not rotate and etc

Even fighting game camera behaves differently in different games, i.e. it moves differently in case your characters only move along one axis, or can step of the axis. Even in that case, you can either actually move your characters or move the arena instead.

For example, currently I'm making a top down game there I'm doing something similar, but I'm using a fixed camera, so I only change camera's y coordinate based on the distance between my player's nodes.
🔎︎



Abunimer
Guest
Quote
2023-03-14 12:34:31

Thanks a lot , that was helpfull


manreal
Guest
Quote
2023-03-15 15:29:02

i tried the same but how does it work for you guys ??


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact