How to attach an oject to the camera

Started by DougFane, October 14, 2011, 03:07:33 PM

Previous topic - Next topic

DougFane

I think I know what the issue is, and I don't know if this is what you said, but here it is:

_______   is the gun

<  is the camera

faced straight ahead:

_______
       <

faced 90 degrees:
       |
       |
       ^
       |

ans so on...

I think this is what was making me think it was moving in a circular motion, because the gun appears to recede and advance. Is this what you were referring to, and is altering the pivot point going to solve it?

AGP

Yes and yes. Does simply calling weapon.setRotationPivot(camera.getPosition()) not work?

EgonOlsen

That would mix camera and object space, which isn't supposed to work very well. Can you post the current value of getRotationPivot()?

DougFane

Well first I would like to say, thank you for all the help. Unfortunately, I accidentally overwrote the file of the project I was working on, and post the value that you are asking for. the good news is that while writing test code for the FPS project I was working on, I thought of an alternate game type that seemed a more worthy venture. Rather than create another shooter, I am going for more of a puzzle/adventure type game. The basic premise is that you are trying to get to a spinning monkey head (don't ask) on a platform. You can run and jump like usual, but you can also shoot large red balls which ca be used as stepping platforms. I will make a new post with a zip file attached that contains a fully functional (albeit simple) version of the game.

Thank you for the help Egon and AGP