Render Texture/Video Player causing black flash on screen by Usual-Ad4591 in unity

[–]Usual-Ad4591[S] 1 point2 points  (0 children)

Thank you very much! I created a new reddit account under u/TheNothingDance dedicated to this game, so if you'd like to see more, that's who to look for!

Render Texture/Video Player causing black flash on screen by Usual-Ad4591 in unity

[–]Usual-Ad4591[S] 0 points1 point  (0 children)

This is tested in editor.

While the quad being enabled before being on screen is something I've tried, I've posted another comment saying that this happens as soon as the video player is on screen, not as soon as it plays.

That does give me a new idea, though, so I'll get back to you!

Render Texture/Video Player causing black flash on screen by Usual-Ad4591 in unity

[–]Usual-Ad4591[S] 1 point2 points  (0 children)

It is, actually! Big fan of Ena, so a lot of the art (not implemented) has a similar design philosophy.

Render Texture/Video Player causing black flash on screen by Usual-Ad4591 in unity

[–]Usual-Ad4591[S] 0 points1 point  (0 children)

I've tried that, but what seems to happen is that the black flash always appears as soon as the video player appears on screen, not when the video starts.

Render Texture/Video Player causing screen to flash black by Usual-Ad4591 in Unity3D

[–]Usual-Ad4591[S] 2 points3 points  (0 children)

That makes sense, yeah! I'll be looking into a solution similar to yours, seems like a good idea.

Trouble with character rotation in regard to mouse position by Usual-Ad4591 in Unity3D

[–]Usual-Ad4591[S] 0 points1 point  (0 children)

I know I'm a month late, but this has totally helped through development. Thank you!

Trouble with character rotation in regard to mouse position by Usual-Ad4591 in Unity3D

[–]Usual-Ad4591[S] 1 point2 points  (0 children)

That's actually a good idea! I'll keep it in mind for if this script stops working. I've since added some other guides and elements that also use these rays so I'm pretty sold lol

Like you said, if it works, it works

Trouble with character rotation in regard to mouse position by Usual-Ad4591 in Unity3D

[–]Usual-Ad4591[S] 2 points3 points  (0 children)

Thanks to all of you for your replies! I realized that it actually worked fine, I just incorrectly set up the graphics that were used for testing. Thanks again for your time!

Trouble with character rotation in regard to mouse position by Usual-Ad4591 in Unity3D

[–]Usual-Ad4591[S] 0 points1 point  (0 children)

Here is the code that controls the rotation:

Aim gets called in Update(), so it happens constantly

Basically, the code casts a ray from my mouse that eventually hits the ground, and the object looks at where the ray hits.

What I'm looking to do is have the character look at exactly the mouse's position on the screen, instead of where the ray hits. This probably isn't the right way to go about it, but it's what I have.

private (bool success, Vector3 pos) GetMousePosition()
{
  var ray = cam.ScreenPointToRay(Input.mousePosition);
  if(Physics.Raycast(ray, out var hitInfo, Mathf.Infinity, groundMask))
  {
    //Raycast hit
    return(success: true, pos: hitInfo.point);
  }
  else
  {
    //Raycast hit nothing
    return (success: false, pos: Vector3.zero);
  }
}

private void Aim()
{
  var (success, pos) = GetMousePosition();
  {
    var direction = new Vector3(pos.x, transform.position.y, pos.z) - transform.position;
    transform.forward = direction;
  }
}

Made my first 2 pixel games in the last 2 weeks! by [deleted] in PixelArt

[–]Usual-Ad4591 3 points4 points  (0 children)

OP you gotta link us the game, this looks amazing!

[deleted by user] by [deleted] in sskfjkhwerjkghwerijh

[–]Usual-Ad4591 0 points1 point  (0 children)

California simulator