Click here to Skip to main content
15,901,001 members
Home / Discussions / C#
   

C#

 
RantCoding error missing reference Pin
uighgg ojgeojge31-Mar-18 1:36
uighgg ojgeojge31-Mar-18 1:36 
AnswerRe: Coding error missing reference Pin
OriginalGriff31-Mar-18 1:47
mveOriginalGriff31-Mar-18 1:47 
QuestionRe: Coding error missing reference Pin
uighgg ojgeojge31-Mar-18 1:58
uighgg ojgeojge31-Mar-18 1:58 
GeneralRe: Coding error missing reference Pin
OriginalGriff31-Mar-18 2:28
mveOriginalGriff31-Mar-18 2:28 
GeneralRe: Coding error missing reference Pin
uighgg ojgeojge31-Mar-18 2:34
uighgg ojgeojge31-Mar-18 2:34 
GeneralRe: Coding error missing reference Pin
Dave Kreskowiak31-Mar-18 8:36
mveDave Kreskowiak31-Mar-18 8:36 
GeneralRe: Coding error missing reference Pin
Pete O'Hanlon31-Mar-18 10:12
mvePete O'Hanlon31-Mar-18 10:12 
QuestionProblem with Rotating Platforms in Unity 3D Pin
O.G.I.30-Mar-18 8:06
O.G.I.30-Mar-18 8:06 
Hello guys,
I'm making a small 3D platformer game with Unity, and I got some serious troubles making the player to walk on the rotating platforms, actually it turns out that it is absolutely impossible for me, I really tried everything, I've read probably all articles in the web about rotating platforms, parenting and so on, but nothing seems to help, even though the problem looks very simple.
What I'm doing is when the player jumps on the platform I make him a parent to that platform so he cam move with it, but in the moment I set him as a parent he turns at some degrees left or right(probably depending in the differences between the angle of the platform rotation and the angle of the player), here is a video that illustrates the problem:
err - YouTube[^]

I really have no idea why this happens and I'm so desperate nothing seems to work and if I can't fix it there is no point in continue making the game Cry | :((
Here is my code for parenting to the rotating platform:
C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;

public class PlatformRide : MonoBehaviour
{
    public GameObject _parent;
    private GameObject _player = null;
    
    // Use this for initialization
    void Start()
    {
        transform.gameObject.GetComponent<Collider>().isTrigger = true;
    }

    // Update is called once per frame
    void LateUpdate()
    {
        if (!Globals.GamePaused)
        {
            _parent.transform.localRotation = transform.rotation; // rotate the parent with the platform
        }
    }

    void OnTriggerEnter(Collider col)
    {
        if (col.name == "CCLSSF_player")
        {
            _player = col.gameObject;
            _player.transform.parent = _parent.transform;
        }
    }

    void OnTriggerStay(Collider col)
    {
        if (col.name == "CCLSSF_player")
        {
            _player = col.gameObject;
            _player.transform.parent = _parent.transform;
        }
    }

    void OnTriggerExit(Collider col)
    {
        if (col.name == "CCLSSF_player")
        {
            _player.transform.parent = null;
            _player = null;
        }
    }

}


I'm using the standard Unity FPS Controller, what could be wrong? Please help,
thank you in advance.
Even though I'm an artist throughout the years spent in coding I started to see that the programming is actually the real art Smile | :) .

AnswerRe: Problem with Rotating Platforms in Unity 3D Pin
Eddy Vluggen30-Mar-18 22:48
professionalEddy Vluggen30-Mar-18 22:48 
GeneralRe: Problem with Rotating Platforms in Unity 3D Pin
O.G.I.30-Mar-18 23:51
O.G.I.30-Mar-18 23:51 
GeneralRe: Problem with Rotating Platforms in Unity 3D Pin
Eddy Vluggen31-Mar-18 3:10
professionalEddy Vluggen31-Mar-18 3:10 
QuestionIPv6 based UDP client which can communicate with 3rd Part IPv6 based UDP Server Pin
SKant0330-Mar-18 0:15
SKant0330-Mar-18 0:15 
AnswerRe: IPv6 based UDP client which can communicate with 3rd Part IPv6 based UDP Server Pin
Gerry Schmitz31-Mar-18 6:50
mveGerry Schmitz31-Mar-18 6:50 
QuestionHow to fix this? Please see my code if what is the solution for 'AssetService.InsertPulloutReturnItems(string, string, string, string)': not all code paths return value.. Thanks Pin
arthur tarrayo29-Mar-18 21:05
arthur tarrayo29-Mar-18 21:05 
AnswerRe: How to fix this? Please see my code if what is the solution for 'AssetService.InsertPulloutReturnItems(string, string, string, string)': not all code paths return value.. Thanks Pin
OriginalGriff29-Mar-18 21:23
mveOriginalGriff29-Mar-18 21:23 
QuestionBuilding custom controls from common wpf controls Pin
Dwayne Barsotta29-Mar-18 2:37
Dwayne Barsotta29-Mar-18 2:37 
AnswerRe: Building custom controls from common wpf controls Pin
Gerry Schmitz29-Mar-18 6:43
mveGerry Schmitz29-Mar-18 6:43 
GeneralRe: Building custom controls from common wpf controls Pin
BillWoodruff30-Mar-18 4:14
professionalBillWoodruff30-Mar-18 4:14 
GeneralRe: Building custom controls from common wpf controls Pin
Gerry Schmitz30-Mar-18 4:45
mveGerry Schmitz30-Mar-18 4:45 
GeneralRe: Building custom controls from common wpf controls Pin
BillWoodruff30-Mar-18 19:55
professionalBillWoodruff30-Mar-18 19:55 
AnswerRe: Building custom controls from common wpf controls Pin
Mycroft Holmes29-Mar-18 15:19
professionalMycroft Holmes29-Mar-18 15:19 
AnswerRe: Building custom controls from common wpf controls Pin
BillWoodruff30-Mar-18 4:05
professionalBillWoodruff30-Mar-18 4:05 
QuestionWpf frameworks or styles Pin
Dwayne Barsotta29-Mar-18 2:24
Dwayne Barsotta29-Mar-18 2:24 
AnswerRe: Wpf frameworks or styles Pin
Pete O'Hanlon29-Mar-18 2:52
mvePete O'Hanlon29-Mar-18 2:52 
AnswerRe: Wpf frameworks or styles Pin
Gerry Schmitz29-Mar-18 6:55
mveGerry Schmitz29-Mar-18 6:55 

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.