File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Assets/Scripts/Interactive/Catchable/Weapon Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,22 @@ public override void Use()
21
21
22
22
var direction = GetComponentInParent < CharacterController > ( ) . VectorDirection ;
23
23
projectile . transform . position = transform . position + new Vector3 ( direction . x , direction . y ) ;
24
+ switch ( GetComponentInParent < CharacterController > ( ) . Direction ) {
25
+ case 1 :
26
+ projectile . transform . eulerAngles = new Vector3Int ( 0 , 0 , 270 ) ;
27
+ break ;
28
+ case 2 :
29
+ projectile . transform . eulerAngles = new Vector3Int ( 0 , 0 , 180 ) ;
30
+ break ;
31
+ case 3 :
32
+ projectile . transform . eulerAngles = new Vector3Int ( 0 , 0 , 90 ) ;
33
+ break ;
34
+ default :
35
+ break ;
36
+ }
24
37
var rb = projectile . GetComponent < Rigidbody2D > ( ) ;
25
38
rb . AddForce ( direction * ProjectileSpeed ) ;
26
- }
39
+ }
27
40
28
41
}
29
42
}
You can’t perform that action at this time.
0 commit comments