Download

The name of the camera?

Hi! I have been trying to create this “gun-like object” for my character (trying to make an old school shooter as an attempt to learn C+++)
and I have been trying to get it fixed on the screen using “AttachParent = Mesh;”. It sort of works, but as you can see, the parent is mesh, not the camera, thus the gun will not follow up/down. What should I replace the “mesh” with to create the proper effect?

Have you tried “AttachTo(FollowCamera)”?

ERROR:“followcamera : undeclared identifier”

You will need to cast to your character. And I am assuming that you are using the first person template. I’m not sure if it’s “FollowCamera” there. You would need to look the name of the camera up.

oh… that might be the problem! I am casting to the mesh, not the character.
In that case how will I structure it?
(cast to character)->(mesh)->AttachTo(FollowCamera)?
(mesh)-> AttachTo((cast to character)->(FollowCamera))?
something else?