- Newest
- Most votes
- Most comments
Hello @REDACTEDUSER
I was able to reproduce the issue you were experiencing. For some reason changing the light color seems to destroy the light render and then recreate it and as such seems to happen on the wrong thread. I've informed the team about this. In the meantime, I'd recommend having two lights set up with the colors that you need and switch them on/off based on what you want to accomplish.
Edit: Alternatively, you can apply the following changes to HttpClientComponent.cpp which would execute the callback on the main thread:
- Add the following include:
#include <AzCore/Component/TickBus.h>
- Replace MakeHttpRequest function with the following:
/*
* HttpClientComponentRequestBus::Handler
*/
void HttpClientComponent::MakeHttpRequest(AZStd::string url, AZStd::string method, AZStd::string jsonBody)
{
#if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
auto job = aznew HttpRequestJob(true, ServiceJob::GetDefaultConfig(),
[this](int responseCode, AZStd::string content)
{
AZ::EntityId entityId = m_entity->GetId();
AZStd::function<void()> requestCallback = [entityId, responseCode, content]() {
EBUS_EVENT_ID(entityId, HttpClientComponentNotificationBus, OnHttpRequestSuccess, responseCode, content);
};
EBUS_QUEUE_FUNCTION(AZ::TickBus, requestCallback);
},
[this](int responseCode)
{
AZ::EntityId entityId = m_entity->GetId();
AZStd::function<void()> requestCallback = [entityId, responseCode]() {
EBUS_EVENT_ID(entityId, HttpClientComponentNotificationBus, OnHttpRequestFailure, responseCode);
};
EBUS_QUEUE_FUNCTION(AZ::TickBus, requestCallback);
}
);
job->SetUrl(url.c_str());
job->SetHttpMethod(method);
job->SetJsonBody(jsonBody.c_str());
job->Start();
#endif // #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
}
Hope that helps.
I'm checking with a tech to see if they know can help you out.
Hello @REDACTEDUSER
Can you post your Lua code? We'd like to investigate which Bus or API call is causing this.
Thank you.
GameplayNotificationBus.Broadcast.OnEventBegin("q1p2-change-color")
LightComponentRequestBus.Event.SetColor(self.Properties.Light, Vector3(200,0,0))
still in version 1.8.1
This post is closed: Adding new answers, comments, and votes is disabled.
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 4 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 4 months ago