Click here to Skip to main content
15,887,302 members
Home / Discussions / C#
   

C#

 
QuestionIncomprehensible errors. Any anybody help me make sense of this? Pin
Member 1207484918-Jul-18 6:49
Member 1207484918-Jul-18 6:49 
AnswerRe: Incomprehensible errors. Any anybody help me make sense of this? Pin
Gerry Schmitz18-Jul-18 13:24
mveGerry Schmitz18-Jul-18 13:24 
QuestionHow to randomly generate a number or characters in an Authorization Class file Pin
Bootzilla3317-Jul-18 4:49
Bootzilla3317-Jul-18 4:49 
AnswerRe: How to randomly generate a number or characters in an Authorization Class file Pin
Gerry Schmitz18-Jul-18 9:38
mveGerry Schmitz18-Jul-18 9:38 
GeneralRe: How to randomly generate a number or characters in an Authorization Class file Pin
Bootzilla3318-Jul-18 10:38
Bootzilla3318-Jul-18 10:38 
GeneralRe: How to randomly generate a number or characters in an Authorization Class file Pin
Gerry Schmitz18-Jul-18 13:06
mveGerry Schmitz18-Jul-18 13:06 
GeneralRe: How to randomly generate a number or characters in an Authorization Class file Pin
Mycroft Holmes18-Jul-18 14:10
professionalMycroft Holmes18-Jul-18 14:10 
QuestionThe animation of my character runs on the spot Pin
Member 1391486817-Jul-18 1:24
Member 1391486817-Jul-18 1:24 
Hello,
I have a probleme with the animation of my caracter. The animation run when my caracter stay put. I use Unity3D

<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
public class PlayerMove : MonoBehaviour {<br />
<br />
    private Animator anim;<br />
    private CharacterController charController;<br />
    private CollisionFlags collisionFlags = CollisionFlags.None;<br />
<br />
    private float moveSpeed = 5f;<br />
    private bool canMove;<br />
    private bool finished_Movement = true;<br />
<br />
    private Vector3 target_Pos = Vector3.zero;<br />
    private Vector3 player_Move = Vector3.zero;<br />
    <br />
    private float player_ToPointDistance;<br />
<br />
    private float gravity = 9.8f;<br />
    private float height;<br />
<br />
    // Use this for initialization<br />
    void Awake () {<br />
        anim = GetComponent<Animator> ();<br />
        charController = GetComponent<CharacterController> ();<br />
    }<br />
    <br />
    // Update is called once per frame<br />
    void Update () {<br />
        MoveThePlayer ();<br />
        charController.Move (player_Move);<br />
<br />
    }<br />
<br />
    void MoveThePlayer() {<br />
        if (Input.GetMouseButtonDown (0)) {<br />
            Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);<br />
            RaycastHit hit;<br />
<br />
            if (Physics.Raycast (ray, out hit)) {<br />
                if(hit.collider is TerrainCollider) {<br />
<br />
                    player_ToPointDistance = Vector3.Distance (transform.position, hit.point);<br />
<br />
                    if (player_ToPointDistance >= 1.0f) {<br />
                        canMove = true;<br />
                        target_Pos = hit.point;<br />
                    }<br />
                }<br />
<br />
            }<br />
<br />
            <br />
        <br />
        }<br />
<br />
        if (canMove ) {<br />
                anim.SetFloat ("Walk", 1.0f);<br />
<br />
                Vector3 target_Temp = new Vector3 (target_Pos.x, transform.position.y, target_Pos.z);<br />
<br />
                transform.rotation = Quaternion.Slerp (transform.rotation,<br />
                    Quaternion.LookRotation (target_Temp - transform.position),<br />
                    15.0f * Time.deltaTime);<br />
<br />
                player_Move = transform.forward * moveSpeed * Time.deltaTime;<br />
<br />
                if(Vector3.Distance (transform.position, target_Pos) <= 0.5f) {<br />
                    canMove = false;<br />
                }<br />
                <br />
            } else {<br />
                player_Move.Set (0f, 0f, 0f);<br />
                anim.SetFloat ("walk", 0f);<br />
            }<br />
<br />
    }<br />
<br />
}<br />
<br />


If someone can help me I would be grateful
AnswerRe: The animation of my character runs on the spot Pin
Gerry Schmitz17-Jul-18 7:37
mveGerry Schmitz17-Jul-18 7:37 
Questionstring replace Pin
Ali Doran16-Jul-18 9:39
Ali Doran16-Jul-18 9:39 
AnswerRe: string replace Pin
Dave Kreskowiak16-Jul-18 10:42
mveDave Kreskowiak16-Jul-18 10:42 
AnswerRe: string replace Pin
Peter_in_278016-Jul-18 11:40
professionalPeter_in_278016-Jul-18 11:40 
AnswerRe: string replace Pin
Gerry Schmitz16-Jul-18 11:46
mveGerry Schmitz16-Jul-18 11:46 
AnswerRe: string replace Pin
jschell16-Jul-18 15:49
jschell16-Jul-18 15:49 
GeneralRe: string replace Pin
Ali Doran16-Jul-18 17:09
Ali Doran16-Jul-18 17:09 
GeneralRe: string replace Pin
OriginalGriff16-Jul-18 19:36
mveOriginalGriff16-Jul-18 19:36 
GeneralRe: string replace Pin
Ali Doran16-Jul-18 22:38
Ali Doran16-Jul-18 22:38 
GeneralRe: string replace Pin
OriginalGriff16-Jul-18 23:07
mveOriginalGriff16-Jul-18 23:07 
GeneralRe: string replace Pin
Ali Doran16-Jul-18 23:34
Ali Doran16-Jul-18 23:34 
GeneralRe: string replace Pin
OriginalGriff16-Jul-18 23:39
mveOriginalGriff16-Jul-18 23:39 
GeneralRe: string replace Pin
Ali Doran17-Jul-18 5:03
Ali Doran17-Jul-18 5:03 
GeneralRe: string replace Pin
OriginalGriff17-Jul-18 5:10
mveOriginalGriff17-Jul-18 5:10 
QuestionMVC Website is working slow Pin
galba201815-Jul-18 21:12
galba201815-Jul-18 21:12 
AnswerRe: MVC Website is working slow Pin
Jochen Arndt15-Jul-18 23:56
professionalJochen Arndt15-Jul-18 23:56 
QuestionZoom Image in the PictureBox where user make selection Pin
Member 1384510215-Jul-18 4:26
Member 1384510215-Jul-18 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.