Results 1 to 12 of 12
  1. #1
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,762

    Default Third person code

    Whats the code to having a fully functional 3rd person camera that is better than the one in Hourences tutorial, i would appreciate the help thank you!

  2. #2
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,556

    Default

    Better in what way?

  3. #3
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,762

    Default

    well just so that the target reticle wont be directly in the middle, like a over the shoulder cam a little closer to the right shoulder and what not, the cam here is a great start but its directly perfectly centered behind the character. which makes for awful aiming i just would like to know how to tweak it, im not much of a coder just artist

  4. #4
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,556

    Default

    I see, well know that we know what you actually want, perhaps someone will be so kind to write the code.

  5. #5
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,762

    Default

    Code:
    simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
    {
    	local vector start, end, hl, hn;
    	local actor a;
    	
    	start = Location;
    	
    	if (Controller != none)
    	{
    		end = Location - Vector(Controller.Rotation) * 192.f;
    	}
    	else
    	{
    		end = Location - Vector(Rotation) * 192.f;
    	}
    	
    	a = Trace(hl, hn, end, start, false);
    	
    	if (a != none)
    	{
    		out_CamLoc = hl;
    	}
    	else
    	{
    		out_CamLoc = end;
    	}
    	
    	out_CamRot = Rotator(Location - out_CamLoc);
    	return true;
    }
    This is the code provided what can be added to make the camera closer to the right shoulder and also above it alittle at an angle?

  6. #6
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,556

    Default

    Well, I've already helped since I wrote the above code. So it's someone else's turn now.

  7. #7

    Default

    You have the Controller rotation there, that's all you really need to do whatever you want with the camera:
    http://wiki.beyondunreal.com/Legacy:...t_Vector_Maths

  8. #8
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,762

    Default

    Thank you very much then , i wasnt sure how to use them

  9. #9

    Default

    Try SetCameraMode('ThirdPerson'); in the Controller...

  10. #10
    MSgt. Shooter Person
    Join Date
    Apr 2009
    Posts
    102

    Default

    Quote Originally Posted by Solid Snake View Post
    Well, I've already helped since I wrote the above code. So it's someone else's turn now.
    Variable names, man.

  11. #11
    Palace Guard
    Join Date
    Aug 2008
    Location
    Location,Location
    Posts
    3,762

    Default

    I still cant get the camera to where i want it to be

    I change the values of
    Code:
    {
    		end = Location - Vector(Controller.Rotation) * 192.f;
    	}
    	else
    	{
    		end = Location - Vector(Rotation) * 192.f;
    and it just moves the cam farther away and at an annoying angle wich makes the character look in a odd angle also

  12. #12
    MSgt. Shooter Person
    Join Date
    Feb 2009
    Posts
    479

    Default

    That's one way of making camera. Another way is to overwrite Pawn.
    Which works better it's hard to say. I have found that overwrting camera in Controller is harder to get work as I want.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.