Je bloque depuis plusieurs mois sur un truc.
J'ai réussi à créer une vue à la troisième personne permettant de regarder autour du personnage sans pour autant changer la direction du personnage (comme par défaut). Donc ça, pas de problèmes, la ou je bloque, c'est que je n'arrive pas à faire en sorte que le personnage se tourne suivant l'axe pressé et se déplace dans cette direction.



J'ai bien idée que ça à un rapport avec la fonction "FaceRotation" ou quelque chose de semblable... mais je peine à m'y retrouver. Une p'tite idée pour m'aiguiller ?
J'ai songé au playerinput, à changer les touches pour appeler mes propres fonctions, mais en fait je ne sais pas trop comment procéder. Mon but serait d'arriver à réaliser un déplacement similaire au jeu "Batman : AA" quand batou marche tranquillement.



(Le code de ma caméra)
Player controller
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class LLOEPlayerController extends UTPlayerController;
 
var private float viewRotationPitch; //Used to store view pitch. Used in GetAdjustedAimFor
 
function UpdateRotation( float DeltaTime )
{
	local Rotator	DeltaRot, newRotation, ViewRotation;
 
	ViewRotation = Rotation;
	if (Pawn!=none)
	{
		Pawn.SetDesiredRotation(ViewRotation);
	}
 
	// Calculate Delta to be applied on ViewRotation
	DeltaRot.Yaw	= PlayerInput.aTurn;
	DeltaRot.Pitch	= PlayerInput.aLookUp;
 
	ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
	SetRotation(ViewRotation);
 
	// Store adjusted pitch in our class variable so we can use it outside of the method.
	self.viewRotationPitch = ViewRotation.Pitch;
 
	ViewShake( deltaTime );
 
	NewRotation = ViewRotation;
	NewRotation.Roll = Rotation.Roll;
 
	// Change our pawn's direction only if we are currently moving.
	if ( Pawn != None && (PlayerInput.RawJoyRight != 0.0 || PlayerInput.RawJoyUp != 0.0))
		Pawn.FaceRotation(NewRotation, deltatime);
}
 
function Rotator GetAdjustedAimFor( Weapon W, vector StartFireLoc )
{
	local Rotator adjustedAimRotator;
 
	// Use our adjusted pitch along with our pawns orientation.
	adjustedAimRotator.Pitch = viewRotationPitch;
	adjustedAimRotator.Roll = Pawn.Rotation.Roll;
	adjustedAimRotator.Yaw = Pawn.Rotation.Yaw;
 
	return adjustedAimRotator;
}
 
 
 //---------------------------------------------------------------------------------------------------
DefaultProperties
{
	CameraClass = class'GameFramework.GamePlayerCamera'
	bBehindView = true
	InputClass=class'LLOE.LLOEPlayerInput'
	Name="Default__LLOEPlayerController"
}