The lectures are beginning to be a little bit hard to keep up

urc_s03_using_physics_handles

#1

Honestly at this point in the lectures things are getting way to rushed, I find myself having to stop the videos multiple times, and look up details before resuming.

The previous use of auto, does not to the use of auto in this lecture justice and an example of what the auto function was accomplishing in this situation should of been included in the video.

After spending 20 minutes of my own research it make sense.

However, I am spending more and more time doing my own research than I am watching these videos, and I will be honest in college I learned that if it takes longer than 3 hours per every hour of content the professor gives, understand/ use the material then the professor is not doing his/her job.

Up to this point I can say you guys have been doing fantastic, but there are a lot of missing pieces now costing me a lot of time, and I payed so I could lean this material in a timly fashion, hopefully you guys can refactor these videos to make things flow easier in the future.

Great example is right now my code is nearly perfect, yet I have an error that componenttograb->getown()… is pointing to an incomplete class type, and you guys do not have this, and I am about to spend probably half an hour figuring out why this is the case, and while this is good for me in terms of learning c++ and troubleshooting, and so much of my time during this course should be spent doing that, but it is getting to the point it is taking away from how effecient the learning process is, and at that point people might as well go watch youtube videos.

here is the example of my code that is causing the problem, the portion with double astrics represent where the issue is being highlighted by the visual studio.

	/// Try and reach any actor with physics body collision channel set
	auto HitResult = GetFirstPhysicsBodyInReach();
	auto ComponentToGrab = HitResult.GetComponent();
	auto ActorHit = HitResult.GetActor();


	/// If we hit something then attach a physics handle

	PhysicsHandle->GrabComponent(
		ComponentToGrab,
		NAME_None,
		**ComponentToGrab->GetOwner()->GetActorLocation(),**
		true // Allow Rotation
	);

#2

So far into video , the error still persist.


#3

Despite this red line the compiler will still build…

tried closing and opening unreal, VS, and cleaning/rebuilding

I guess I could just ignore the red line… but it does bug me


I attempted to make a Grabspot that would just be updated to the location that I wanted to grab but upon attempting to move in the world after compiling the game crashes lol

{
	/// Try and reach any actor with physics body collision channel set
	auto HitResult = GetFirstPhysicsBodyInReach();
	auto ComponentToGrab = HitResult.GetComponent();
	auto ActorHit = HitResult.GetActor();
	auto GrabSpot = ActorHit->GetOwner()->GetActorLocation();



	/// If we hit something then attach a physics handle

	if (ActorHit != nullptr)
	{

		PhysicsHandle->GrabComponent(
			ComponentToGrab,
			NAME_None,
			//GrabSpot,
			

			ComponentToGrab->GetOwner()->GetActorLocation(),
			true // Allow Rotation
		);
	}

#4

I realized I had some redudancy in my code, and there was no reason to try to ->get owner to only -> get location because the owner of the actor class was the defualt actor class and getting its location is like WOAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

and thus a crash.

So the solution to get rid of the redline is as follows

i left the // commented in, because I dont trust myself and in case things get broken later I can see if swapping my solution out with the old solution that would build , will still build and fix the problem that arrives.


in the end my solution, took me an hour to get to, and I feel like it didnt really make me better at coding, or help me learn to material any, which thus feels like a waste of time.

So hopefully this is a good example of what I am talking about when it comes to the time wasting things that have slowly generated overtime in your videos causing students havoc.

I understand these things probably didnt exsist when you made the video, and maybe everything flowed perfectly then but I still think there are somethings like the use of auto instead of the class type for the ComponentToGrab class left me wondering why, and i spent time looking that up.

I understand no one is perfect, but I do feel like in each video series the early videos where very good about making sure to address qurestions that students may have, and as the videos in the series progress less questions where addressed, probably because the focus point of the videos where more detailed leaving more room for missing out on things that may cause confusion.

I typically don’t even post about them because that takes even more of my time to do, and I consider myself very good at noticing the small things that cause big problems, and if I stopped to write about everyone one I would probably still be at the first or second video of building escapes.


#5

another edit,

my GrabSpot solution only works for a little bit,

after about 10-15 seconds the UE will crash.

Where as the CompontToGrab->GetOwner()=>GetActorLocation(), will not crash, but cause unreal to think there is an error that leaves a nasty red dot on my screen when coding.

I am not sure why it crashes with grabspot, and why there is an error on my componenttograb-> and there is not one on the toturial videos.

Honestly I have wasted to much time with this, 36 minutes is all I should of had to spend for a 12 minute video to understand it , assuming all previously learned material was given the same rule.

Therefor something is missing prior to this video or during this video.


#6

Ye, please. I need a help in this lessions, because i had a different situations when

  1. UE crashed
  2. Grab not working
  3. red line with error
  4. removed error and using actor location

But now i have only situation, when i can push table or chair via my bode and hold via grabber. This object will be at position when i grab, but not moving with me


#7

Still no response to this post,

also the issue previously mentioned in this post was resolved already by the next video ( I think, I am yet to watch it, just inferring from the title of the video, maybe it will also fix this red line as well)

Well, not for me, the solution only made my problem way more extreme.

Well I will keep this updated if i find a solution


#8

Hello Kiaph,

Whilst I haven’t checked the Unreal course specifically, all of the other GameDev.tv courses suggest the appropriate places for feedback/questions, in particular, if you are experiencing an issue with course related content the Udemy Q&A is the most appropriate place to post. The reason for this is as follows;

  • the Instructors tend not to frequent the forum that often, as such, your topic will be buried under a volume of other topics and no easily spotted
  • as such, responses you receive on the forum are more likely to come from your peers, other students working through the course also, but they may not be able to help you, depending on their own experience/knowledge
  • the Q&A on Udemy is staffed by a student instructor who is there to respond to students queries, if it is something they are unable to help/resolve they are in a position to escalate the issue to an instructor for their comment enabling them to then feedback

I would urge you to raise your issue in the Q&A against the specific lecture, by doing so you are very likely to get a response and hopefully one that will assist you. You could, in addition to summarising the issue there, pop a link to your topic here for additional reference.

On a related note, your topic title isn’t really a question, it suggests more of your opinion, this may also be why you haven’t seen many responses. Often people will be happy to help resolve questions but don’t always feel comfortable adding to/challenging an opinion, certainly not in a public environment. I would also recommend indicating in your body of text the issue more clearly. Your opening topic is fairly lengthy so it takes a bit of reading before you get to the issue/point you are making, you could for example use Markdown to do something like this;

Issue

Red squiggly line in code on line 133

That would stand out fairly well even with all of the other text. The bold title is created using 3 # characters in a row before the word.

### Issue

Finally, I don’t know whether it helps or not, but looking at the screenshots you provided, the one on the right appears to have a badly formed method, there is a missing closing curly brace. I’ve not dabbled in C, but with C# this would prevent the compiler from understanding the code that follows, e.g. the next method would not be recognised as a method, you end up with a cascade of errors, all from one missing closing curly brace. As I say, not sure whether this helps or not but thought I’d offer it.

I hope you get a suitable and helpful response in the Q&A :slight_smile:


#9

Thanks for the information Rob :smiley:

I will attempt to do so.

The one on the right as mentioned at the end of your response is actually just his video running, paused, so I imagine it is resolved before the end of the video.


#10

You’re very welcome and aha! I thought that was perhaps your copy of Visual Studio opened over the top of the browser, my apologies. :slight_smile:


#11

I am sure who ever posted this has moved on, but GrabComponent function was deprecated. True using GrabComponentAtLocation or GrabComponentAtLocationwithRotation. Also, remember you need to include header files if you using a new unreal engine version.

here a snippet from what I got so far:

#include "Grabber.h"
#include "Engine/World.h"
#include "GameFramework/PlayerController.h"
#include "DrawDebugHelpers.h"
#include "CollisionQueryParams.h"
#include "PhysicsEngine/PhysicsHandleComponent.h"
#include "Components/PrimitiveComponent.h"


#define OUT //just to give context that a parameter is out

void UGrabber::Grab()
{
	UE_LOG(LogTemp, Warning, TEXT("Grabbing!"));

	///LINE TRACE and see if we reach any actors with physics body collision channel set
	FHitResult HitResult = GetFirstPhysicsBodyInReach();
	UPrimitiveComponent *ComponentToGrab = HitResult.GetComponent();
	AActor *ActorHit = HitResult.GetActor();
	///If we hit something then attach a physics handle
		
	if (ActorHit)
	{
		// TODO attach physics handle
		PhysicsHandle->GrabComponentAtLocationWithRotation
		(
			ComponentToGrab,
			NAME_None,
			ComponentToGrab->GetOwner()->GetActorLocation(),
			ComponentToGrab->GetOwner()->GetActorRotation()
		);
	}
}