Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9149495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:29:05+00:00 2026-06-17T11:29:05+00:00

In probably the best error message I’ve gotten in awhile, I’m curious as to

  • 0

In probably the best error message I’ve gotten in awhile, I’m curious as to what went wrong.

The original code

float currElbowAngle = LeftArm ? Elbow.transform.localRotation.eulerAngles.y 
                               : 360f - Elbow.transform.localRotation.eulerAngles.y

I’m using Unity3d and C#; LeftArm is a bool type and according to documentation Elbow.transform.localRotation.eulerAngles.y returns a float value.

This code gives me the error :

There exists both implicit conversions from ‘float’ and ‘float’ and
from ‘float’ to ‘float’

This fixes it:

float currElbowAngle = LeftArm ? (float) Elbow.transform.localRotation.eulerAngles.y 
                               : 360f - Elbow.transform.localRotation.eulerAngles.y

So my question is this: What was that error trying to communicate and what actually went wrong?

Update 1: Elbow is a GameObject and this error is in Visual Studio

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:29:06+00:00Added an answer on June 17, 2026 at 11:29 am

    The ternary (e?a:b) operator is slightly trickier for the type system, because both sides need to give the same return type. I wouldn’t be surprised if there were a subtle bug there. It’s good that compliers make us laugh once in a while.

    This probably fixes it too:

    float currElbowAngle = LeftArm ? 0.0f + Elbow.transform.localRotation.eulerAngles.y 
                                   : 360f - Elbow.transform.localRotation.eulerAngles.y
    

    I’m speculating that the trouble is that your true branch is an lvalue and the false branch is an rvalue. My workaround makes both branches an rvalue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An error has occurred. See error log for more details. java.lang.NullPointerException (Probably The best
The question is probably not the best one to describe my issue but I
This will probably be obvious but I can't find the best way. I want
This is probably a stupid question, but what's the best way to clear class
As you can probably tell by the title, I'm not sure the best way
Although this probably isn't best practice, I am trying to clear a series of
I am probably missing something simple here but I feel it best to ask
This is probably real simple, but I don't know best way to do this.
everyone. I'm having a memory allocation error using ctypes and a C code. I'm
I have a Perl Subversion pre-commit hook . A mysterious error message popped up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.