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 Classic Chat / CreateEntity / Parent of an object

Author
Message
Xaron
9
Years of Service
User Offline
Joined: 3rd May 2014
Location: Germany
Posted: 12th Jan 2018 15:21
Hey there,

coming from BB3D initially there was quite a useful command called CreateEntity, which basically just give you a handle to an empty entity. Is there something similar?
I used that to make it parent to a camera, which leads to the second question:
Can I set a parent (object) for the camera so it moves along with the object?
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Jan 2018 22:25 Edited at: 12th Jan 2018 22:27
i think in agk you must create an dummy object which you can connect via FixObjectToObject
and then you need to set the camera positon/rotation same this object.

without dummy object you can set camera to a object pos./rot and move/rotate it local along any axis to your desired location/angle.
...
MoveCameraLocalX ( cameraID, amount )
MoveCameraLocalY ( cameraID, amount )
MoveCameraLocalZ ( cameraID, amount )
RotateCameraLocalX ( cameraID, amount )
RotateCameraLocalY ( cameraID, amount )
RotateCameraLocalZ ( cameraID, amount )

https://www.appgamekit.com/documentation/Reference/3D.htm
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 13th Jan 2018 10:38 Edited at: 13th Jan 2018 10:47
I'm currently not really using a dummy for the cam object.


But I'm sure that would make it even better, for gives bit more control.
You could create a box object with CreateObjectBox(), set it invisible with SetObjectVisible() and turn of it's collision with SetObjectCollisionMode() otherwise it would still be messing with things, then use FixObjectToObject() as Markus said.
puzzler2018
User Banned
Posted: 13th Jan 2018 11:08
without a dummy object, we cannot use it to build objects that can rotate properly (on a pivot) so i think its best to use a small .1,.1,.1 sphere or something as a pivot and then build objects fixobject2object onto that sphere

Login to post a reply

Server time is: 2024-03-29 01:24:51
Your offset time is: 2024-03-29 01:24:51