#Help pls

1 messages · Page 1 of 1 (latest)

paper robin
#

So how far have you gone codewise? Anything we can look at?

normal zodiac
#

I believe so- My instructor told me to download a toggle script to use on the placeholder human mesh

#

at one point i actually had it so colliding with the mesh disabled the dialogue window- I dont know why it doesnt occur anymore.

paper robin
#

Can you show your code?

toxic plaza
#

on the placeholder character attach a script with OnCollisionEnter(){}

lone maple
#

If the character has a trigger already, you can use OnTriggerEnter on either it or the player character. That'll fire whenever a Rigidbody enters the trigger area

#

If it's a solid collider, the same but with OnCollisionEnter instead

normal zodiac
#
using System.Collections;

public class ToggleObjectTrigger : MonoBehaviour
{
    public GameObject Object;
    public bool SetObject = false;


    void OnTriggerEnter (Collider other) 
    { //this is looking for another object with the tag "player"
        if (other.gameObject.tag == "Player")
        {
            Object.SetActive(SetObject);
        }
    }
        
}```
toxic plaza
#

Triggers will let the character pass through

normal zodiac
#

This is my toggle script on my placeholder

paper robin
#

Maybe you removed the player tag from your player object?

normal zodiac
#

I doubt that- the controller still has the tag

toxic plaza
#

collision will be like a car accident, and will simulate physics

normal zodiac
paper robin
#

do you get any errors?

lone maple
#

Does either object have a Rigidbody on it?

paper robin
#

And how are you moving your player? With physics or transform.position = ?

normal zodiac
#

I have no idea- we were given a third person controller and havent touched it.

spring stone
normal zodiac
#

the player has a rigid body on it. the placeholder doesn't

toxic plaza
#
  if(collision.gameObject.tag == "Player")
            {
                Debug.Log("you hit me!");
            }
        }```
normal zodiac
#

Originally I wanted the player to be able to simply walk up to the mesh and press an interact key like F or E to intitiate the dialogue, like In skyrim or any other game

#

But collision seems easier

toxic plaza
#

if using trigger make sure it's checked as a trigger

normal zodiac
#

(this is my placeholder mesh)

#

Its ticked as a trigger

toxic plaza
paper robin
#

Just put a Debug.Log("other"); in your OnTriggerEnter without any if statement to see, if it actually hits.

lone maple
toxic plaza
#

ok then use the OnTriggerEnter loop

normal zodiac
#

I don't know what that means, Sorry

toxic plaza
#

rigidbody3d

normal zodiac
#

I'm an art student

toxic plaza
#

add component

#

type in rigidbody

lone maple
#

Rigidbody3D is just a normal Rigidbody

toxic plaza
#

dont use the 2D one

normal zodiac
#

So both actors need rigidbodies on them

spring stone
#

hah, same path i took. art student to programmer . . .

normal zodiac
#

It's being forced onto us

paper robin
#

Never a bad thing to know the other side

normal zodiac
#

This is a group project and im the only person willing to do this >_> but hey programming is cool

normal zodiac
#

Putting the rigidbody on the placeholder npc made it dissapear (possibly fell through the map?)

toxic plaza
#

that is likely, freeze it's position

normal zodiac
#

Just untick use gravity?

toxic plaza
#

sure

spring stone
toxic plaza
normal zodiac
#

Got it

#

So essentially I want this show conversation thing to appear when colliding with the white character- but right now it persists on the HUD

#

permanently

toxic plaza
#

did you drag in the text gameobject to the inspector field for Object?

#

also instead of using SetObject bool, just pass in true for now

#

and disable the start conversation text gameobject in the hierarchy before you hit play

normal zodiac
#

Like so?

toxic plaza
#

or actually set it before using it. before calling Object.SetActive(SetObject); Say SetObject = !SetObject

normal zodiac
toxic plaza
#

um no, the eyeball just disables the visibility

normal zodiac
#

Would I tick the canvas?

toxic plaza
#

no the canvas, but the text element specifically

#

untick the text gameobject and you'll see it go grey in the hierarchy

normal zodiac
#

Wont this just make it a white block?

toxic plaza
#

that is the component

normal zodiac
toxic plaza
#

you want to disable the gameobject above that

#

and I would child the white background under the text as well

normal zodiac
#

This is very confusing I'm sorry.

toxic plaza
normal zodiac
#

This is where every single one of my dialogue components exist

toxic plaza
#

is the button what you want to pop up?

#

Test Button?

normal zodiac
#

Kind of

toxic plaza
#

or all of it?

normal zodiac
#

I want all of it to appear, the dialogue is animated

#

Like so

#

ugh embed fail

toxic plaza
#

if you want all of that to pop up, then add an empty as a parent to all of it and then disable it

normal zodiac
#

This would work then correct?

#

since this is an empty

toxic plaza
#

it might, but I usually leave the canvas enabled and put a parent empty below the canvas and disable that

normal zodiac
#

So just add an empty below that dialogue system empty?

toxic plaza
#

below the canvas

normal zodiac
#

Create empty parent? or just empty

#

oh

#

parent

toxic plaza
#

just empty

normal zodiac
#

oh

#

nvm

#

Sorry!

toxic plaza
#

haha it's okay

normal zodiac
#

and put everything below it, inside of it?

toxic plaza
#

yes

normal zodiac
#

Got it

toxic plaza
#

I'm not sure what dialoguemanager does but we'll go with it

normal zodiac
#

I was following a Brackeys tutorial
https://www.youtube.com/watch?v=_nRzoTzeyxU

Let’s make a Dialogue System that you can easily tweak to suit your game!

● Listen to the Podcast: http://bit.ly/2un4o0m

● Download the Project: http://bit.ly/2t45YYc
● Download the Font: http://www.dafont.com/6809-chargen.font
● Singleton: http://wiki.unity3d.com/index.php/Singleton

♥ Support Brackeys on Patreon: http://patreon.com/brackeys/...

▶ Play video
#

It just contains a dialogue manager script

#

which I dont exactly know what it does either..

#

_>

toxic plaza
#

I would drag the dialogue manager up above and put it at the same level as dialogue system parent empty

normal zodiac
#

Like so?

toxic plaza
#

yeah perfect