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.

Dark GDK / Gun wont follow the camera

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 6th Aug 2009 10:35
I can\'t seem to find why my logic isn\'t working, I\'m sure it\'s something really simple that I\'m just overlooking. But I have programmed it so that when the user moves around, the shotgun that I have loaded should follow the camera?

relevant code:



Any help would be greatly appreciated

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 6th Aug 2009 13:21
are you positioning it and rotating it in your main loop?


Your signature has been erased by a mod
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 7th Aug 2009 01:11
No

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 7th Aug 2009 01:14
Do it


Your signature has been erased by a mod
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 7th Aug 2009 13:47
I tried it and it didn't work

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 7th Aug 2009 15:52
Load the object outside your main loop.... then update it's position in the loop....

In your function, those assignments of camera position and object postion are static, once they are made, thats what they are till its assigned again. I mean, telling an object to position itself somewhere, means it will be positioned at that spot until its told specifically to move somewhere else, even if you pass it something like camera position, it will just take the current position, it wont update like I think you are expecting.

If it ain't broke.... DONT FIX IT !!!
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 8th Aug 2009 03:48
No,

Positioning it at the camera then locking it would make it stay at the camera, that's what the documentation says, and it doesn't matter anyway now because I have fixed it.

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 8th Aug 2009 07:26
locking it just makes it stay on the cameras view, if you want ot animate it all, you need to put it in your main loop and load it outside the loop.

Login to post a reply

Server time is: 2024-10-06 07:38:34
Your offset time is: 2024-10-06 07:38:34